xterm's colors were likely chosen in the mid-1990s to more or less match the colors seen on an CGA display. The 256- and 88-color palettes were designed by Todd Larason (patch #111) and Stephen Wall (patch #115) in 1999 to provide easily programmed color palettes (and with compatibility of the 8-, 16-color subsets in mind). Aside from some dispute over the shade of blue used, those have been unchanged since then. The extended (beyond 16) colors are preset with compiled-in defaults generated by a script.
Any of the colors can be altered at runtime using control sequences, as well as queried for their values using control sequences. The xterm sources include several sample scripts, including query-color.pl
, which shows how to query the colors using OSC 4
.
The first 16 colors correspond also to X resources, whose values can be seen in
appres XTerm
Both gnome-terminal and konsole come with some odd color contrasts which can only be explained by having a design committee involved in look-and-feel. Thus, "black" may not actually be black, but a pleasing (sic) shade of gray. Both do allow customization, neither documents the colors used (aside from source-code).
The question about entering color-scheme information into gnome-terminal has been asked before. Here are a few useful links:
As noted here, gnome-terminal stores its settings (including color-schemes) via tools which change from release to release: