Skip to content

Custom Text Effects and Styling#

Effect#

Enumerable class of all available effects.

Options:

Effect Custom Reset Example
Bold Effect.BOLD Effect.BOLD_OFF This is BOLD
Dim Effect.DIM Effect.DIM_OFF This is DIMMED
Underline Effect.UNDERLINE Effect.UNDERLINE_OFF This is UNDERLINED
Blink Effect.BLINK Effect.BLINK_OFF This is BLINKING
Reverse Effect.REVERSE Effect.REVERSE_OFF This is REVERSED
Hide Effect.HIDE Effect.HIDE_OFF This is HIDDEN
- - Effect.OFF -

Example:

Example
Python
1
2
3
4
5
from colorist import Effect

print(f"I want {Effect.UNDERLINE}underlined text{Effect.UNDERLINE_OFF}")

print(f"I want {Effect.BOLD}emphasized text{Effect.BOLD_OFF}")

How it appears in the terminal:

% I want underlined text
% I want emphasized text

Tip

Similar to Color.OFF, remember to turn off an effect with the relevant reset option (e.g Effect.BOLD_OFF, Effect.DIM_OFF, etc. or even just Effect.OFF) every time you want to revert back to the default terminal text style. Otherwise, the effect may spill over and into other terminal messages.