Color



next up previous contents
Next: Keyboard Up: Manipulation of Shared Previous: Grabs

Color

X supports several color models, including monochrome, greyscale, pseudocolor and true color. With monochrome and true color, there is a one-to-one mapping between the colors available to an application and the colors supported by the display hardware. So if the display hardware supports 16 million different colors simultaneously, an application can use as many of the colors as it needs. Pseudocolor supports the mapping of a limited number of application colors to a large number display colors. When a vendor states that a particular hardware/software combination supports 256 different simultaneous colors out of a palette of 16 million, that is describing the use of pseudocolor. The table that maps each of those 256 application colors to an actual display color is called a colormap.

An application may share a colormap with other applications, or may allocate a private colormap. If the shared colormap is writable, any application may change the colors in the colormap. This allows a malicious or misbehaving application to deny access to the shared colormap to other applications, or to change the on-screen appearance of other applications by modifying the shared colormap.


John Barkley
Fri Oct 7 16:17:21 EDT 1994