number and namebluegreenred
0 black000
1 red001
2 green010
3 yellow011
4 blue100
5 magenta101
6 cyan110
7 white111

terminal escape codes: "ESC[3n;m", where ESC is byte \033=0x1B=^[, n is the colour number from above, and the "[3" and "m" are a literal opening-square-bracket, three, and m. reset with ESC[0m. use 4 instead of 3 for background colours, and in some terminals, 9 and 10 for bright foreground or background. use the colour number "9" for the terminal default, in case it differs from all of the other defined colours. insert more graphical controls at once into a single escape code by separating the numbers with a semicolon before terminating the whole sequence with the m.

wikipedia: ansi escape code


posted 2018-01-30 | index