ticterm.esc¶
Classes¶
- class ticterm.esc.Style(value, value_off='\\x1b[m')¶
Terminal escape code style
- Parameters:
value (
str
) – Escape sequence to enable stylevalue_off (
str
) – Escape sequence to disable style
- add(*styles)¶
Combines self with all styles
- Return type:
Self
- replace_normal(item)¶
Replaces all instances of
ticterm.esc.color.normal
in items.- Parameters:
style
items
- Return type:
str
- replace_normal_many(items)¶
Maps
Style.replace_normal()
to items iterable- Parameters:
items (
iter
)- Return type:
map
- wrap(item)¶
Wraps str(item) with
value
andvalue_off
(if available)- Parameters:
item (
str
|Any
)- Return type:
str
- wrap_many(items)¶
Maps
Style.wrap()
to items iterable- Parameters:
items (
iter
)- Return type:
map
-
value:
str
¶
-
value_off:
str
¶
ticterm.esc.color¶
Constants¶
- ticterm.esc.color.color_names: list[str] = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']¶
List of color names.
- ticterm.esc.color.color_bright_map: dict[str, str] = {'brblack': 'black', 'brblue': 'blue', 'brcyan': 'cyan', 'brgreen': 'green', 'brmagenta': 'magenta', 'brred': 'red', 'brwhite': 'white', 'bryellow': 'yellow'}¶
List of color names prepended with ‘br’ mapped to their non-bright counterparts.
- ticterm.esc.color.color_map: dict[str, int] = {'black': 30, 'blue': 34, 'cyan': 36, 'green': 32, 'magenta': 35, 'red': 31, 'white': 37, 'yellow': 33}¶
Map of color names to their ansi escape code ids.
Color Constants¶
- ticterm.esc.color.black¶
- ticterm.esc.color.red¶
- ticterm.esc.color.green¶
- ticterm.esc.color.yellow¶
- ticterm.esc.color.blue¶
- ticterm.esc.color.magenta¶
- ticterm.esc.color.cyan¶
- ticterm.esc.color.white¶
- ticterm.esc.color.brblack¶
- ticterm.esc.color.brred¶
- ticterm.esc.color.brgreen¶
- ticterm.esc.color.bryellow¶
- ticterm.esc.color.brblue¶
- ticterm.esc.color.brmagenta¶
- ticterm.esc.color.brcyan¶
- ticterm.esc.color.brwhite¶
Functions¶
- ticterm.esc.color.get(color, *, bg=False)¶
Get color or style from input. Accepts
Style
objects, ansi color ids, or names.
ticterm.esc.style¶
Style Constants¶
- ticterm.esc.style.bold¶
- ticterm.esc.style.dim¶
- ticterm.esc.style.italic¶
- ticterm.esc.style.underline¶
- ticterm.esc.style.blinking¶
- ticterm.esc.style.inverse¶