cachai.utilities.strcol
- cachai.utilities.strcol(string, c='white')[source]
Applies ANSI color codes to a string (only work in terminal/output cells).
- Parameters
- string
str The string you want to color.
- c
strorint Color to color the string with. This can be a number from the ANSI 8-bit color codes (between 0 and 255) or a string of one of the predefined colors:
"white","black","light_gray","dark_gray","gold","red","blue","green","magenta","mint","orange".
- string
- Returns
str
Examples
import cachai.utilities as chu print(chu.strcol("Magenta text",c="magenta"))
Magenta text