Colors
Text color is manipulated using CSI n m sequence.
| Intensity | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Normal | Black | Red | Green | Yellow | Blue | Magenta | Cyan | White |
| Bright | Black | Red | Green | Yellow | Blue | Magenta | Cyan | White |
There are two other color standards CSS/HTML standard colors and X Window colors which standardize both the color names and associated RGB color values, but the escape sequence standard only specifies the color names, not RGB values. The chart below shows default RGB assignments for some common terminal programs, together with the CSS and the X-Window colors for these color names.
| Color name | Standard VGA colors | Windows XP command prompt |
Terminal.app | PuTTY | xterm | CSS/HTML | X Window | |
|---|---|---|---|---|---|---|---|---|
| Normal | Black | 0, 0, 0 | 0, 0, 0 | 0, 0, 0 | 0, 0, 0 | 0, 0, 0 | 0, 0, 0 | 0, 0, 0 |
| Red | 170, 0, 0 | 128, 0, 0 | 194, 54, 33 | 187, 0, 0 | 205, 0, 0 | 255, 0, 0 | 255, 0, 0 | |
| Green | 0, 170, 0 | 0, 128, 0 | 37, 188, 36 | 0, 187, 0 | 0, 205, 0 | 0, 255, 0 | 0, 128, 0 | |
| Brown/yellow | 170, 85, 0 | 128, 128, 0 | 173, 173, 39 | 187, 187, 0 | 205, 205, 0 | 255, 255, 0 | 255, 255, 0 | |
| Blue | 0, 0, 170 | 0, 0, 128 | 73, 46, 225 | 0, 0, 187 | 0, 0, 238 | 0, 0, 255 | 0, 0, 255 | |
| Magenta | 170, 0, 170 | 128, 0, 128 | 211, 56, 211 | 187, 0, 187 | 205, 0, 205 | 255, 0, 255 | 255, 0, 255 | |
| Cyan | 0, 170, 170 | 0, 128, 128 | 51, 187, 200 | 0, 187, 187 | 0, 205, 205 | 0, 255, 255 | 0, 255, 255 | |
| Gray | 170, 170, 170 | 192, 192, 192 | 203, 204, 205 | 187, 187, 187 | 229, 229, 229 | 255, 255, 255 | 255, 255, 255 | |
| Bright/light | Darkgray | 85, 85, 85 | 128, 128, 128 | 129, 131, 131 | 85, 85, 85 | 127, 127, 127 | ||
| Red | 255, 85, 85 | 255, 0, 0 | 252,57,31 | 255, 85, 85 | 255, 0, 0 | |||
| Green | 85, 255, 85 | 0, 255, 0 | 49, 231, 34 | 85, 255, 85 | 0, 255, 0 | 144, 238, 144 | 144, 238, 144 | |
| Yellow | 255, 255, 85 | 255, 255, 0 | 234, 236, 35 | 255, 255, 85 | 255, 255, 0 | 255, 255, 224 | 225, 255, 224 | |
| Blue | 85, 85, 255 | 0, 0, 255 | 88, 51, 255 | 85, 85, 255 | 92, 92, 255 | 173, 216, 230 | 173, 216, 230 | |
| Magenta | 255, 85, 255 | 255, 0, 255 | 249, 53, 248 | 255, 85, 255 | 255, 0, 255 | |||
| Cyan | 85, 255, 255 | 0, 255, 255 | 20, 240, 240 | 85, 255, 255 | 0, 255, 255 | 224, 255, 255 | 224, 255, 255 | |
| White | 255, 255, 255 | 255, 255, 255 | 233, 235, 235 | 255, 255, 255 | 255, 255, 255 |
The VGA column denotes the typical colors that are used when booting PCs and leaving them in their classical 80×25 text mode. The colors are different in the EGA/VGA graphic modes.
In July 2004, the blue colors of xterm changed, RGB (0,0,205) → (0,0,238) for normal and (0,0,255) → (92,92,255) for bright. As of 2010, old xterm versions still linger on many computers though.
Recent-enough versions of KDE's Konsole program support 24-bit foreground and background color setting:
https://github.com/robertknight/konsole/blob/master/tests/color-spaces.pl QuotingRead more about this topic: ANSI Escape Code
Famous quotes containing the word colors:
“Few colors last; with their eternal thirst, time and light suck on them, and they bleach the black doctors hat until its grey like a dunces cap.”
—Franz Grillparzer (17911872)
“Color is my day-long obsession, joy and torment. To such an extent indeed that one day, finding myself at the deathbed of a woman who had been and still was very dear to me, I caught myself in the act of focusing on her temples and automatically analyzing the succession of appropriately graded colors which death was imposing on her motionless face.”
—Claude Monet (18401926)
“Hoot how the inhuman colors fell
Into place beside her, where she was,
Like human conciliations, more like
A profounder reconciling, an act,
An affirmation free from doubt.”
—Wallace Stevens (18791955)