Colors
Tip
Follow the Beautiful UIs guide for examples.!
ColorType
¶
ColorType: t.TypeAlias = t.Literal[
"black",
"red",
"green",
"yellow",
"blue",
"magenta",
"cyan",
"white",
"default",
"bright_black",
"bright_red",
"bright_green",
"bright_yellow",
"bright_blue",
"bright_magenta",
"bright_cyan",
"bright_white",
"bright_default",
]
Styler
¶
class Styler(
fg: ColorType | None = None,
bg: ColorType | None = None,
bold: bool = False,
italic: bool = False,
dim: bool = False,
underline: bool = False,
blink: bool = False,
reverse: bool = False,
strikethrough: bool = False,
reset: bool = False,
hide: bool = False,
)
style
¶
def style(
*messages: t.Any,
fg: ColorType | None = None,
bg: ColorType | None = None,
bold: bool = False,
italic: bool = False,
dim: bool = False,
underline: bool = False,
blink: bool = False,
reverse: bool = False,
strikethrough: bool = False,
reset: bool = False,
hide: bool = False,
) -> str
print
¶
def cprint(
*messages: t.Any,
fg: ColorType | None = None,
bg: ColorType | None = None,
bold: bool = False,
italic: bool = False,
dim: bool = False,
underline: bool = False,
blink: bool = False,
reverse: bool = False,
strikethrough: bool = False,
reset: bool = False,
hide: bool = False,
file: SupportsWrite | None = None,
end: str | None = "\n",
) -> None