Solaris X Window System Developer's Guide

Color Name Database

The color name database provides a mapping between ASCII color names and RGB color values. This mapping increases the portability of color programs and eases programming. Note that this mapping is subjective and has no objective scientific basis.

The source of the database is /usr/openwin/lib/X11/rgb.txt. This file is identical to the one provided in X11R6 from the X Consortium. rgb.txt is compiled into the dbm(3) database files, rgb.dir and rgb.pag. When the server starts up, it builds an internal representation of rgb.dir and rgb.pag used to map a color name to a color value.

X11 clients use XLookupColor or XAllocNamedColor to map a color name to a color value. The color name string passed to these routines is converted to lowercase before it is looked up in the database.