9.2 Color Functions

A color is represented by a CLX color object, in which each of the red, green, and blue values is specified by an rgb-val -- a floating point number between 0.0 and 1.0. (see paragrpah 1.6, Data Types). The value 0.0 represents the minimum intensity, while 1.0 represents the maximum intensity. CLX automatically converts rgb-val values into 16-bit integers when sending colors to an X server. The X server, in turn, scales 16-bit color values to match the actual intensity range supported by the screen.

Colors used on :gray-scale screens must have the same value for each of red, green, and blue. Only one of these values is used by screen hardware to determine intensity; however, CLX does not define which of red, green, or blue is actually used.

The following paragraphs describe the CLX functions used to create, access, and modify colors.



make-color &key (:blue 1.0) (:green 1.0) (:red 1.0) &allow-other-keys Function
        
:blue, :green, :red
rgb-val values that specify the saturation for each primary.

Creates, initializes, and returns a new color object with the specified values for red, green, and blue.

color
Type color.


color-blue color Function
        
color
A color object.

Returns and (with setf) sets the value for blue in the color.

blue-intensity
Type rgb-val.


color-green color Function
        
color
A color object.

Returns and (with setf) sets the value for green in the color.

green-intensity
Type rgb-val.


color-p color Function
        

Returns non-nil if the argument is a color object and nil otherwise.

color-p
Type boolean.


color-red color Function
        
color
A color object.

Returns and (with setf) sets the value for red in the color.

red-intensity
Type rgb-val.


color-rgb color Function
        
color
A color object.

Returns the values for red, green, and blue in the color.

red, green, blue
Type rgb-val.