color ¤
Text colorizing and theme configuration logic.
Modules:
Classes:
Functions:
-
normal– -
black– -
red– -
green– -
yellow– -
blue– -
purple– -
cyan– -
light_gray– -
foreground– -
gray– -
light_red– -
light_green– -
light_yellow– -
light_blue– -
light_purple– -
light_cyan– -
white– -
bold– -
underline– -
colorize– -
nocolor– -
unstylize– -
generateColorFunctionInner– -
generateColorFunction– -
strip– -
terminateWith– -
ljust_colored– -
rjust_colored–
Attributes:
-
NORMAL– -
BLACK– -
RED– -
GREEN– -
YELLOW– -
BLUE– -
PURPLE– -
CYAN– -
LIGHT_GREY– -
LIGHT_GRAY– -
FOREGROUND– -
GREY– -
GRAY– -
LIGHT_RED– -
LIGHT_GREEN– -
LIGHT_YELLOW– -
LIGHT_BLUE– -
LIGHT_PURPLE– -
LIGHT_CYAN– -
WHITE– -
BOLD– -
UNDERLINE– -
none– -
ansi_escape_8bit– -
disable_colors–
ansi_escape_8bit module-attribute ¤
ansi_escape_8bit = compile(
"(?:\\x1B[@-Z\\\\-_]|[\\x80-\\x9A\\x9C-\\x9F]|(?:\\x1B\\[|\\x9B)[0-?]*[ -/]*[@-~])"
)
disable_colors module-attribute ¤
disable_colors = add_param(
"disable-colors",
bool(get("NO_COLOR")),
"whether to color the output or not",
)
ColorParamSpec ¤
ColorConfig ¤
ColorConfig(namespace: str, params: list[ColorParamSpec])
generateColorFunctionInner ¤
generateColorFunctionInner(
old: Callable[[object], str], new: Callable[[str], str]
) -> Callable[[object], str]