In X, a color is defined by a set of three numeric values, representing intensities of red, green, and blue. Red, green, and blue are referred to as the primary hues. A colormap is a list of colors, each indexed by an integer pixel value. Each entry in a colormap is called a color cell. Raster graphics displays store pixel values in a special screen hardware memory. As the screen hardware scans this memory, it reads each pixel value, looks up the color in the corresponding cell of a colormap, and displays the color on its screen.
The colormap abstraction applies to all classes of visual types supported by X, including those for screens which are actually monochrome. For example, :gray-scale screens use colormaps in which colors actually specify the monochrome intensity. A typical black-and-white monochrome display has a :static-gray screen with a two-cell colormap.
The following list describes how pixel values and colormaps are handled for each visual class.
CLX provides functions to create colormaps, access and modify colors and color cells, and install colormaps in screen hardware.