

Since I’m often in the position of trying to remember what colours are what, I have a handy script called: ~/bin/ansi_colours: #!/usr/bin/python Much of the above is drawn from the Wikipedia page “ ANSI escape code“. Support for “true color” terminals is listed here. So you can put pinkish text on a brownish background using \033[38 2 255 82 197 48 2 155 106 0mHello
C LANGUAGE ANSI ESCAPE SEQUENCES FULL
Now we are living in the future, and the full RGB spectrum is available using: \033[38 2 m #Select RGB foreground color The 8-bit colours are arranged like so: 0x00-0x07: standard colors (same as the 4-bit colours)Ġx10-0圎7: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)Ġ圎8-0xFF: grayscale from black to white in 24 steps Using these above, you can make pink text like so: \033[38 5 206m #That is, \033[38 5 mĪnd make an early-morning blue background using \033[48 5 57m #That is, \033[48 5 mĪnd, of course, you can combine these: \033[38 5 206 48 5 57m Technology advanced, and tables of 256 pre-selected colours became available, as shown below. Generally speaking, the naming, use, and grouping of colours in human languages is fascinating. However, digging deeper into these languages shows that each uses colour in distinct ways. ( More information here)ĭifferences between languages are also interesting: note the profusion of distinct colour words used by English vs. Red appears 15 times, while yellow and green appear only 10 times. Homer’s Odyssey contains black almost 200 times and white about 100 times. It may also be why the Bible does not contain the colour blue.

This may be why story Beowulf only contains the colours black, white, and red.

C LANGUAGE ANSI ESCAPE SEQUENCES SERIES
Where XXX is a series of semicolon-separated parameters. The ANSI escape sequences you’re looking for are the Select Graphic Rendition subset.
