Next Prev Up

9.3.4 Finding Colors

A CLX program can ask the X server to return the colors stored in allocated color cells. The server also maintains a dictionary of color names and their associated color values. CLX provides a function to look up the values for common colors by names such as "red", "purple", and so forth. The following paragraphs describe the CLX functions for returning the color values associated with color cells or with color names.

lookup-color colormap name Function
A colormap.
A stringable color name.

Returns the color associated by the X server with the given color name. The name must contain only ISO Latin-1 characters; case is not significant. The first value returned is the closest approximation to the requested color possible on the screen hardware. The second value returned is the true color value for the requested color.

screen-color, exact-color
Type color.

query-colors colormap pixels &key (:result-type 'list) Function
A colormap.
A sequence of pixel values.
A subtype of sequence that indicates the type of sequences returned.

Returns a sequence of the colors contained in the allocated cells of the colormap specified by the given pixels. The values returned for unallocated cells are undefined.

Type sequence of color.

Next Prev Up
© 1988, 1989 Texas Instruments Incorporated
Conversion to HTML made by Gilbert Baumann.
Last build: Tue Dec 16 23:30:42 1997