ml.utils.colors
Defines helper functions for printing colored text to the terminal.
Colors can be disabled by setting DISABLE_COLORS=1
in the environment.
- ml.utils.colors.get_colorize_parts(color: Literal['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan'], bold: bool = False) tuple[str, str] [source]
- ml.utils.colors.colorize(s: str, color: Literal['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan'], bold: bool = False) str [source]
- ml.utils.colors.maybe_colorize(s: str, color: Literal['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan'] | None, bold: bool = False) str [source]
- ml.utils.colors.make_bold(strs: list[str], inner: Literal['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan'] | None = None, side: Literal['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'light-red', 'light-green', 'light-yellow', 'light-blue', 'light-magenta', 'light-cyan'] | None = None) str [source]