chore: correct package issues

This commit is contained in:
Benexl
2025-08-16 19:08:39 +03:00
parent 99c67a4bc0
commit 5976ab43b2
246 changed files with 96 additions and 96 deletions

29
viu_cli/cli/utils/ansi.py Normal file
View File

@@ -0,0 +1,29 @@
# Define ANSI escape codes as constants
RESET = "\033[0m"
BOLD = "\033[1m"
INVISIBLE_CURSOR = "\033[?25l"
VISIBLE_CURSOR = "\033[?25h"
UNDERLINE = "\033[4m"
def get_true_fg(color: list[str], bold: bool = True) -> str:
"""Custom helper function that enables colored text in the terminal
Args:
bold: whether to bolden the text
string: string to color
r: red
g: green
b: blue
Returns:
colored string
"""
# NOTE: Currently only supports terminals that support true color
r = color[0]
g = color[1]
b = color[2]
if bold:
return f"{BOLD}\033[38;2;{r};{g};{b};m"
else:
return f"\033[38;2;{r};{g};{b};m"