Next Prev Up Top Contents Index

11.3 Color specs

A color spec is an object which numerically defines a color in some color-model. For example the object returned by the call:

(color:make-rgb 0.0s0 1.0s0 0.0s0) =>
  #(:RGB 0.0s0 1.0s0 0.0s0)

defines the color green in the RGB color model. (Note that short-floats are used; this results in the most efficient color conversion process. However, any floating-point number type can be used.)

To find out what color-spec is associated with a color name, use the following function.

get-color-spec

Function

get-color-spec color-name

Returns the color-spec associated with the symbol color-name . If there is no color-spec associated with color-name , this function returns nil . If color-name is the name of a color alias, the color alias is dereferenced until a color-spec is found.

Color-specs are made using standard functions make-rgb , make-hsv and make-gray . For Example:

(color:make-rgb 0.0s0 1.0s0 0.0s0)
(color:make-hsv 1.2s0 0.5s0 0.9s0)
(color:make-gray 0.66667s0)

The predicate color-spec-p can be used to test for color-spec objects. The function color-spec-model returns the model in which a color-spec object has been defined.


LispWorks CAPI User Guide - 14 Dec 2001

Next Prev Up Top Contents Index