Source code for slickml.utils._format

from slickml.base import ExtendedEnum


[docs] class Colors(ExtendedEnum): """Colors for foreground and background. Methods ------- names() Returns a list of color names as string values() Returns a list of color values as string to_dict() Returns a dictionary of all colors name-value pairs as string Examples -------- >>> from slickml.utils import Colors >>> Colors.RED >>> str(Colors.BLUE) >>> Colors.names() >>> Colors.values() >>> Colors.to_dict() """ # Generic PURPLE = "\033[95m" CYAN = "\033[96m" DARKCYAN = "\033[36m" BLUE = "\033[94m" GREEN = "\033[92m" YELLOW = "\033[93m" RED = "\033[91m" BOLD = "\033[1m" UNDERLINE = "\033[4m" END = "\033[0m" # Foreground F_Default = "\x1b[39m" F_Black = "\x1b[30m" F_Red = "\x1b[31m" F_Green = "\x1b[32m" F_Yellow = "\x1b[33m" F_Blue = "\x1b[34m" F_Magenta = "\x1b[35m" F_Cyan = "\x1b[36m" F_LightGray = "\x1b[37m" F_DarkGray = "\x1b[90m" F_LightRed = "\x1b[91m" F_LightGreen = "\x1b[92m" F_LightYellow = "\x1b[93m" F_LightBlue = "\x1b[94m" F_LightMagenta = "\x1b[95m" F_LightCyan = "\x1b[96m" F_White = "\x1b[97m" # Background B_Default = "\x1b[49m" B_Black = "\x1b[40m" B_Red = "\x1b[41m" B_Green = "\x1b[42m" B_Yellow = "\x1b[43m" B_Blue = "\x1b[44m" B_Magenta = "\x1b[45m" B_Cyan = "\x1b[46m" B_LightGray = "\x1b[47m" B_DarkGray = "\x1b[100m" B_LightRed = "\x1b[101m" B_LightGreen = "\x1b[102m" B_LightYellow = "\x1b[103m" B_LightBlue = "\x1b[104m" B_LightMagenta = "\x1b[105m" B_LightCyan = "\x1b[106m" B_White = "\x1b[107m"