Next: , Previous: , Up: Colors   [Contents][Index]


10.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 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.

Function: make-color &key (:blue 1.0) (:green 1.0) (:red 1.0) &allow-other-keys
: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.

Function: color-blue color
color

A color object.

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

blue-intensity

Type rgb-val.

Function: color-green color
color

A color object.

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

green-intensity

Type rgb-val.

Function: color-p color

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

color-p

Type boolean.

Function: color-red color
color

A color object.

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

red-intensity

Type rgb-val.

Function: color-rgb color
color

A color object.

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

red
green
blue

Type rgb-val.


Next: , Previous: , Up: Colors   [Contents][Index]