CharacterVisual
Module: terminaltexteffects.engine.animation
A class for storing symbol, color, and terminal graphical modes for the character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
The unformatted symbol. |
required |
bold
|
bool
|
Bold mode. |
False
|
dim
|
bool
|
Dim mode. |
False
|
italic
|
bool
|
Italic mode. |
False
|
underline
|
bool
|
Underline mode. |
False
|
blink
|
bool
|
Blink mode. |
False
|
reverse
|
bool
|
Reverse mode. |
False
|
hidden
|
bool
|
Hidden mode. |
False
|
strike
|
bool
|
Strike mode. |
False
|
colors
|
ColorPair | None
|
The symbol's colors. |
None
|
_fg_color_code
|
str | int | None
|
The symbol's foreground color code. |
None
|
_bg_color_code
|
str | int | None
|
The symbol's background color code. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
formatted_symbol |
str
|
The current symbol with all ANSI sequences applied. |
Methods:
| Name | Description |
|---|---|
format_symbol |
Formats the symbol for printing by applying ANSI sequences for supported active modes and color. |
Source code in terminaltexteffects/engine/animation.py
__post_init__()
Create the formatted symbol by applying ANSI sequences for any active modes and color.
format_symbol()
Format the symbol for printing by applying ANSI sequences for supported active modes and color.
The dim attribute is stored on the visual but is not currently emitted as an ANSI sequence.