We can set color text or foreground color text in the terminal in Python. I have gone through this SO's answer. Some of the example color code is here
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[96m'
print(f"{bcolors.OKGREEN}Yes we can set any Hex color in terminal?{bcolors.ENDC}")
Everything is okay. But you may be noticed we have a few color codes to set. After the digging drive, I found some other color code source from Microsoft docs. I have two of my questions here.
- What does the mean of the code like
BOLD = '\033[1m'
(pattern means)? - Can we convert/use any Hex color code in the terminal? the color source is limited so, can we use any hex code in the terminal?