The Color Database

The color database is used by XParseColor, XLookupColor, and XStoreNamedColor. These routines make it easier to allow the user to specify color names. Use of these names for routine color allocation of read-only colorcells is encouraged since this increases the chance of sharing colorcells and thereby makes the colormap go further before running out of colorcells. The location in the file system of the text version of the color database is an implementation detail, but by default on a UNIX system it is /usr/lib/X11/rgb.txt.

It should be noted that while these color names are present in the standard X11 distribution, they are not specified by the X11 Protocol or Xlib. Therefore, it is permissible for server vendors to change the color names, though most will probably only add colors rather than take them away. Furthermore, hardware vendors must change the RGB values for each display hardware to achieve the proper “gamma correction” so that the colors described by the name really generate that color. The RGB values in the standard file are for the DEC VR290 display. The color that appears on a Sun system given these RGB values for “pink,” for example, looks more like light burgundy.

Each color in Table D-1 (see next page) may be used in the form shown or in mixed case, with initial capitals and all spaces eliminated.

Table D-1. The Text Version of the Color Database


Get Xlib Reference Manual for Version 11 of the X Window System now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.