BLACK = f'{ESC}[30m' module-attribute

Black foreground color

BLACK_BG = f'{ESC}[40m' module-attribute

Black background color

BLUE = f'{ESC}[34m' module-attribute

Blue foreground color

BLUE_BG = f'{ESC}[44m' module-attribute

Blue background color

BOLD = f'{ESC}[1m' module-attribute

Set bold mode

CURSOR_RESTORE_POS = f'{ESC}8' module-attribute

Restores the cursor to the last saved position

CURSOR_SAVE_POS = f'{ESC}7' module-attribute

Save cursor position

CYAN = f'{ESC}[36m' module-attribute

Cyan foreground color

CYAN_BG = f'{ESC}[46m' module-attribute

Cyan background color

ERASE_LINE = f'{ESC}[2K' module-attribute

Erase the entire line

GREEN = f'{ESC}[32m' module-attribute

Green foreground color

GREEN_BG = f'{ESC}[42m' module-attribute

Green background color

NEGATIVE = f'{ESC}[7m' module-attribute

Set inverse mode

PURPLE = f'{ESC}[35m' module-attribute

Purple foreground color

PURPLE_BG = f'{ESC}[45m' module-attribute

Purple background color

RED = f'{ESC}[31m' module-attribute

Red foreground color

RED_BG = f'{ESC}[41m' module-attribute

Red background color

RESET = f'{ESC}[0m' module-attribute

Reset styles and colors

WHITE = f'{ESC}[37m' module-attribute

White foreground color

WHITE_BG = f'{ESC}[47m' module-attribute

White background color

YELLOW = f'{ESC}[33m' module-attribute

Yellow foreground color

YELLOW_BG = f'{ESC}[43m' module-attribute

Yellow background color

ansi_len(s)

Get string length, excluding ansi sequences

Source code in pzp/ansi.py
89
90
91
def ansi_len(s: str) -> int:
    "Get string length, excluding ansi sequences"
    return len(ANSI_RE.sub("", s))