Tech News
← Back to articles

Clashes between web and X11 colors in the CSS color scheme

read original related products more articles

In computing, on the X Window System, X11 color names are represented in a simple text file, which maps certain strings to RGB color values. It was traditionally shipped with every X11 installation, hence the name, and is usually located in /lib/X11/rgb.txt . The web colors list is descended from it but differs for certain color names.[1]

Color names are not standardized by Xlib or the X11 protocol. The list does not show continuity either in selected color values or in color names, and some color triplets have multiple names. Despite this, graphic designers and others got used to them, making it practically impossible to introduce a different list. In earlier releases of X11 (prior to the introduction of Xcms), server implementors were encouraged to modify the RGB values in the reference color database to account for gamma correction.[2]

As of X.Org Release 7.4 rgb.txt is no longer included in the roll up release,[3] and the list is built directly into the server.[4] The optional module xorg/app/rgb contains the stand-alone rgb.txt file.

The list first shipped with X10 release 3 (X10R3) on 7 June 1986, having been checked into RCS by Jim Gettys in 1985.[5] The same list was in X11R1 on 18 September 1987. Approximately the full list as is available today shipped with X11R4 on 29 January 1989, with substantial additions by Paul Ravelling (who added colors based on Sinclair Paints samples), John C. Thomas (who added colors based on a set of 72 Crayola crayons he had on hand) and Jim Fulton (who reconciled contributions to produce the X11R4 list). The project was running DEC VT240 terminals at the time, so would have worked to that device.[6]

In some applications multipart names are written with spaces, in others joined together, often in camel case. They are usually matched insensitive of case and the X Server source code contains spaced aliases for most entries; this article uses spaces and uppercase initials except where variants with spaces are not specified in the actual code.

Clashes between web and X11 colors in the CSS color scheme [ edit ]

The first versions of Mosaic and Netscape Navigator used the X11 colors as the basis for the web colors list, as both were originally X applications. The W3C specifications SVG and CSS level 3 module Color eventually adopted the X11 list with some changes.[7] The present W3C list is a superset of the 16 "VGA colors" defined in HTML 3.2 and CSS level 1.

One notable difference between X11 and W3C is the case of "Gray" and its variants. In HTML, "Gray" is specifically reserved for the 128 triplet (50% gray) . However, in X11, "gray" was assigned to the 190 triplet (74.5%) , which is close to W3C "Silver" at 192 (75.3%) , and had "Light Gray" at 211 (83%) and "Dark Gray" at 169 (66%) counterparts. As a result, the combined CSS 3.0 color list that prevails on the web today produces "Dark Gray" as a significantly lighter tone than plain "Gray" , because "Dark Gray" was descended from X11 – for it did not exist in HTML nor CSS level 1[8] – while "Gray" was descended from HTML. Even in the current draft for CSS 4.0, dark gray continues to be a lighter shade than gray.[9] Some browsers such as Netscape Navigator insisted on an "a" in any "Gray" except for "Light Grey".

Recent X releases (since 2014, xorg-rgb version 1.0.6)[10] also support the W3C definitions. In X11, the original definitions have been preserved (so "Dark Gray" remains a darker shade of "Gray"), but for every conflicting name pair, "Web" and additional "X11" prefixes have been added to ease disambiguation after the merger. The "X11" prefix is an alias for the non-prefixed version, i.e. "X11 Gray" = "Gray" ≠ "Web Gray". The W3C also defined a color that is equal to X11's "Green", but called it "Lime". In X11, this is simply called "Lime", as no such name existed before. It aliases to "Green", i.e. "Lime" = "Green" = "X11 Green" ≠ "Web Green".

Color names with clashing definitions Color name X11 color W3C color Hex Red Green Blue Sample Sample Hex Red Green Blue Gray #BEBEBE 75% 75% 75% #808080 50% 50% 50% Green #00FF00 0% 100% 0% #008000 0% 50% 0% Maroon #B03060 69% 19% 38% #800000 50% 0% 0% Purple #A020F0 63% 13% 94% #800080 50% 0% 50%

... continue reading