picop.cyansi#
ANSI SGR escape sequences for terminals.
- class picop.cyansi.BACKGROUND_COLORS_8#
Bases:
objectStandard 8-color ANSI background escape sequences (SGR 40–47).
- BLACK = '\x1b[40m'#
- BLUE = '\x1b[44m'#
- CYAN = '\x1b[46m'#
- GREEN = '\x1b[42m'#
- MAGENTA = '\x1b[45m'#
- RED = '\x1b[41m'#
- WHITE = '\x1b[47m'#
- YELLOW = '\x1b[43m'#
- class picop.cyansi.BOLD_COLORS_256#
Bases:
objectBold foreground color variants.
- RED = '\x1b[31;1m'#
- class picop.cyansi.FOREGROUND_COLORS_256#
Bases:
objectSelected 256-color ANSI foreground sequences (SGR 38;5;n).
- BLUE_DEFAULT = '\x1b[38;5;39m'#
- BLUE_ULTRAMARINE = '\x1b[38;5;33m'#
- GREEN_JUNGLE = '\x1b[38;5;79m'#
- GREY = '\x1b[38;21m'#
- ORANGE = '\x1b[38;5;208m'#
- RED = '\x1b[38;5;196m'#
- YELLOW = '\x1b[38;5;226m'#
- class picop.cyansi.FOREGROUND_COLORS_8#
Bases:
objectStandard 8-color ANSI foreground escape sequences (SGR 30–37).
- BLACK = '\x1b[30m'#
- BLUE = '\x1b[34m'#
- CYAN = '\x1b[36m'#
- GREEN = '\x1b[32m'#
- MAGENTA = '\x1b[35m'#
- RED = '\x1b[31m'#
- WHITE = '\x1b[37m'#
- YELLOW = '\x1b[33m'#
- picop.cyansi.ansi_bg8(code)#
Return an 8-color background SGR for
code.Notes
Table hit for codes
40–47.
- picop.cyansi.ansi_bold(on=True)#
Return bold-on SGR, or reset when
onis false. :type on:bool, default:True:param on:- Return type:
- picop.cyansi.ansi_fg8(code)#
Return an 8-color foreground SGR for
code.Notes
Table hit for codes
30–37.
- picop.cyansi.ansi_fg256(n)#
Return a 256-color foreground SGR for palette index
n.Notes
Table lookup for indices
0–255.
- picop.cyansi.ansi_strip(s)#
Remove CSI sequences from
sin a single pass.Notes
Returns
sunchanged when no CSI sequences are present.