Colorize Text
The Color class provides standard ANSI escape sequences as attributes for adding color to terminal text output.
Supported colors
Section titled “Supported colors”| Attribute | Escape | Attribute | Escape |
|---|---|---|---|
| RED | \033[31m | LIGHTRED | \033[91m |
| GREEN | \033[32m | LIGHTGREEN | \033[92m |
| YELLOW | \033[33m | LIGHTYELLOW | \033[93m |
| BLUE | \033[34m | LIGHTBLUE | \033[94m |
| MAGENTA | \033[35m | PURPLE | \033[95m |
| DARKCYAN | \033[36m | CYAN | \033[96m |
| BOLD | \033[1m | UNDERLINE | \033[4m |
| END | \033[0m |
Always use
ENDto close a colorized text block and prevent bleed.
Class attributes are returned as strings and can be interpolated directly into output strings.
from falconpy import Color
result = f"This string contains {Color.RED}red {Color.BOLD}bold{Color.END} text"print(result)Output
Section titled “Output”This string contains red bold text