X11 color names

In computing, on the X Window System, X11 color names are represented in a simple text file, which maps certain strings to RGBcolor values. It was traditionally shipped with every X11 installation, hence the name, and is usually located in <X11root>/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 Crayolacrayons he had on hand) and Jim Fulton (who reconciled contributions to produce the X11R4 list). The project was running DECVT240 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.

Perhaps most unusual of the color clashes 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 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".

The following chart presents the standardized X11 color names from the X.org source code.[11] The list of names accepted by browsers following W3C standards[12] slightly differs as explained above. The table does not show numbered gray and brightness variants as described below. Actual rgb.txt files and other color databases or palettes may differ since they are freely editable by vendors and users. The table shows component values in several notations of the RGB color space, i.e. RGB, HSL and HSV, conversions are done assuming sRGB color space.

The complete rgb.txt defines 101 shades from 'Gray0' (black) up to 'Gray100' (white) in addition to 'Gray' and its variants listed above. The shades are apparently defined by the formula GrayN := round(N% × 255) resulting in e.g. 'Gray96' , which happens to be the same as 'White Smoke'. Similarly 'Dim Gray' is the same as 'Gray41' .

On the other hand, 'Gray' lies between 'Gray74' and 'Gray75' ; 'Dark Gray' is not the same as 'Gray66' ; and 'Light Gray' is not the same as 'Gray83' .

These shades are not included in W3C specifications, although drafts for level 4 of the CSS Color module include a similar function gray(). They are still coded without 'Grey' alternatives, but with no space before the digit.

For 78 colors (not counting grays), rgb.txt offers four variants "color1", "color2", "color3", and "color4", with "color1" sometimes corresponding to "color", so e.g. "Snow1" is the same as "Snow". Unlike base colors, e.g. cadet blue and CadetBlue, these are only coded without spaces, e.g. CadetBlue3. These variations are neither supported by popular browsers nor adopted by W3C standards. Whether or not a certain color has such variants seems random.

If "color1" is not the same as "color", the base color is usually darker. That means its brightness in HSB color notation is less than 100%; about 30 of the base colors are fully bright. The four variants (1…4) have rounded brightness values of 100%, 93%, 80% and 55%, respectively. Their hue and saturation are usually the same except for rounding. In some cases they differ from the base color, though, which may indicate that these variants were specified with alternate definitions of the bases in mind, i.e. their values were adapted to a certain monitor which was commonly done by vendors until the 1990s.

The fixed brightness settings correspond closely to these formulae to determine the RGB values:

Some color names appear to be brightness or saturation modifications of others because they bear prefixes such as Dark, Light, Medium, Pale or Deep, but there is no systematic variation apparent. Several sets, however, feature a Dark variant with 55% brightness and some have their Medium at about 80%.

"Light Goldenrod Yellow" and "Dark Olive Green" are special, because there are no corresponding color entries without Dark and Light prefixes.