14.3.1 Standard Colormap Properties and Atoms

Several standard colormaps are available. Each standard colormap is defined by a property, and each such property is identified by an atom. The following list names the atoms and describes the colormap associated with each one. The X11/Xatom.h header file contains the definitions for each of the following atoms, which are prefixed with XA_.
This atom names a property. The value of the property is an array of XStandardColormap structures. Each entry in the array describes an RGB subset of the default color map for the Visual specified by visual_id.

Some applications only need a few RGB colors and may be able to allocate them from the system default colormap. This is the ideal situation because the fewer colormaps that are active in the system the more applications are displayed with correct colors at all times.

A typical allocation for the RGB_DEFAULT_MAP on 8-plane displays is 6 reds, 6 greens, and 6 blues. This gives 216 uniformly distributed colors (6 intensities of 36 different hues) and still leaves 40 elements of a 256-element colormap available for special-purpose colors for text, borders, and so on.

This atom names a property. The value of the property is an XStandardColormap .

The property defines the best RGB colormap available on the screen. (Of course, this is a subjective evaluation.) Many image processing and three-dimensional applications need to use all available colormap cells and to distribute as many perceptually distinct colors as possible over those cells. This implies that there may be more green values available than red, as well as more green or red than blue.

For an 8-plane PseudoColor visual, RGB_BEST_MAP is likely to be a 3/3/2 allocation. For a 24-plane DirectColor visual, RGB_BEST_MAP is normally an 8/8/8 allocation.

These atoms name properties. The value of each property is an XStandardColormap.

The properties define all-red, all-green, and all-blue colormaps, respectively. These maps are used by applications that want to make color-separated images. For example, a user might generate a full-color image on an 8-plane display both by rendering an image three times (once with high color resolution in red, once with green, and once with blue) and by multiply-exposing a single frame in a camera.

This atom names a property. The value of the property is an XStandardColormap .

The property describes the best GrayScale colormap available on the screen. As previously mentioned, only the colormap, red_max, red_mult, and base_pixelmembers of the XStandardColormap structure are used for GrayScale colormaps.

Next: Setting and Obtaining Standard Colormaps

Christophe Tronche, ch@tronche.com