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:

pixel
- 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.
flag
- 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.



Dave.Marshall@cm.cf.ac.uk
Tue May 24 16:52:56 BST 1994