There’s a reason the characters in a Linux terminal can be so bright and colorful. . .

Try it once, and you can mix and match whatever you want.
That’s right — \33[ is the key.
First,
\33[1m~\33[8mcontrol the character style
\33[31m~\33[37mcontrol the text colorAnd
\33[40m~\33[47mcontrol the background color
This should be easy enough to follow, so here are a few more advanced ones.
\33[0mturns off all display effects. TheseASCIIeffects can be sticky: once you use one, the subsequentprintfcalls keep repeating the last effect setting, so you need it to close all attributes — you’ll see when you try it.
\33[2Jclears the screen
It’s very easy to experiment under Linux —
take the echo command for example.
1 | echo "\033[32mhello world" |
This prints green text.

But I suggest getting into a good habit when setting styles:
1 | echo "\033[0;33mhello world\033[0m" |

- Clear the previous settings before printing, then apply your own, and clear again on exit — otherwise the last effect setting keeps repeating. Doing just one of them also works; doing both is simply stricter.