jonasjacek/colors

"Xterm Names" are inaccurate

romainl opened this issue · 2 comments

The colors in xterm's 256color palette are not named. This means that arbitrarily assigning them names pulled from another palette, /usr/lib/X11/rgb.txt in this case, and listing those names under "Xterm Name" is highly misleading.

Moreover, the colors that are, in fact, based on X11 colors by default, 0 to 15, are associated to the wrong X11 color names.

I would suggest either renaming the column with a more straightforward name like "Name Of The Closest X11 Color" or removing the column altogether.

As said above, the names of colors 16-231 (generally) don't match with /usr/lib/X11/rgb.txt, although the names of the grayscale ramp, i.e. colors 232-255, match with /usr/lib/X11/rgb.txt.

In addition, XTerm does name the colors in its default 16-color palette, i.e. colors 0-15 (See XTERM(1)), which match with /usr/lib/X11/rgb.txt, but are listed wrong in this table, which are actually as follows:

color0 : black (#000000)           color8  : gray50 (#7f7f7f)         
color1 : red3 (#cd0000)            color9  : red (#ff0000)            
color2 : green3 (#00cd00)          color10 : green (#00ff00)          
color3 : yellow3 (#cdcd00)         color11 : yellow (#ffff00)         
color4 : mod. dark blue (#0000ee)  color12 : mod. light blue (#5c5cff)
color5 : magenta3 (#cd00cd)        color13 : magenta (#ff00ff)        
color6 : cyan3 (#00cdcd)           color14 : cyan (#00ffff)           
color7 : gray90 (#e5e5e5)          color15 : white (#ffffff)          

I came to write about the 16 main colors and then saw this issue, so I thought I'd write it here.

FWIW, colors 0-15 are not really "named" in xterm:

  • Their default value is set to that of the corresponding X11 color (modified in some cases) but their class is still color0 to color15 (or 0 to 15).

  • color5 (or 5) and magenta3 are not mutually exchangeable.

    Where color5 is expected, magenta3 is very unlikely to work.

    Where magenta3 is expected, color5 may be used (I doubt it but well…) but, as it is user-configurable, without any guarantee of actually looking like the standardised magenta3 from rgb.txt.