X11 Colors in the Terminal
Resources
- Color Strings
- X11 Built-in Color Names
- rgb.txt (no longer used by the X11 server as of this commit)
- Wikipedia: X11 Color Names
- tmux's Implementation of parsing an X11 color
Accepted Formats
Survey of terminal support (parsing) for various color formats for use with OSC 10 and friends.
| Terminal | rgb:<r>/<g>/<b> | #<r><g><b> | named | rgbi:<r>/<g>/<b> | additional |
|---|---|---|---|---|---|
| hterm | yes | yes | yes | no | |
| xterm.js | yes | yes | no | no | |
| iTerm2 | yes | yes | no | no | |
| Terminal.app 1 | yes | yes | no | yes | |
| Alacritty | yes | yes | no | no | |
| Contour | yes 2 | yes 3 | no | no | |
| vte | yes | yes | yes 4 | no | |
| Konsole using QColor | no 5 | yes | yes 4 | no | |
| QTerminal | no | no | no | no | |
| foot | yes 6 | yes 7 | no | no | |
| xterm (uses X11) | yes | yes | yes | yes | |
| WezTerm | yes 6 | yes | yes | no | hsl:..., css colors, transparent, none, clear |
| kitty | yes | yes | yes | no | |
| Rio | yes | yes | no | no | |
| rxvt-unicode | yes | yes 7 | yes | yes | |
| mrxvt | no | no | no | no | |
| Eterm | no | no | no | no | |
| anyterm | no | no | no | no | |
| Terminology | yes | yes | no | yes | |
| tmux | yes | yes | yes | no | cmyk:.., cmy:... both of which come from mintty |
| mintty | yes | yes | yes | no | cmyk:.., cmy:..., rrr,ggg,bbb |
| Termux | yes | yes | no | no | |
| st (uses X11) | yes | yes | yes | yes | |
| Windows Console Host | yes | yes | yes | no |
Emitted Formats
Survey of the format used by terminals in response to OSC 10 / OSC 11 queries.
| Terminal | rgb:<r>/<g>/<b> | additional |
|---|---|---|
| hterm | — | — |
| xterm.js | 16-bit | |
| iTerm2 | 16-bit 8 | |
| Terminal.app 1 | 16-bit | |
| Alacritty | 16-bit | |
| Contour | 16-bit | |
| vte | 16-bi | |
| Konsole | 16-bit | |
| QTerminal | — | — |
| foot | 16-bit | |
| xterm | TODO | TODO |
| WezTerm | 16-bit | |
| kitty | 16-bit | |
| Rio | 16-bit | |
| rxvt-unicode | 16-bit | rgba:<r>/<g>/<b>/<a>, 16-bit |
| mrxvt | — | — |
| Eterm | — | — |
| anyterm | — | — |
| Terminology | 16-bit | #<r><g><b>, 8-bit |
| tmux | 16-bit | |
| mintty | 16-bit | |
| Termux | 16-bit | |
| st | 16-bit | |
| Windows Console Host | — | — |
1
Tested without access to the source code.
2
Only 8-bit (i.e. two hex digits) per channel supported (e.g. rgb:fe/fe/fe but not rgb:f/f/f or rgb:fee/fee/fee)
3
Only one or two hex digits per channel supported (e.g. #fff or #fefefe but not #feefeefee)
4
Refers to the SVG color keyword names, not the X11 list.
5
Note that it still reports the color in the rgb:<r>/<g>/<b> format when queried.
6
In addition, colors with alpha are supported i.e rgba:<r>/<g>/<b>/<a>.
7
In addition, colors with alpha are supported i.e. [aa]#<r><g><b>.
8
But can be configured to use 8-bit color values.