Next: Colour Database Up: Colour Previous: Displaying Colour

Colour in X/Motif

X allows the setting of colour in a variety of ways.

Recall: Xlib performs all colour operation in X.

At the heart of all colour operations is the XColor structure, which uses 3 basic elements:

- the colour index to the colourmap. It is an unsigned long data type.
red, green, blue
- Direct coding of RGB values. The values of theses can range from 0 (off) - 65535 (full) as they are defined as unsigned shorts.
- allow specification of which RGB values are used. Or together DoRed, DoGreen, DoBlue as required.

There are 2 basic methods that can be used to allocate colour in X.
Tue May 24 16:52:56 BST 1994