A color spec is an object which numerically defines a color in some color-model. For example the object returned by the call:
(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 function get-color-spec. It returns the color-spec associated with a symbol. If there is no color-spec associated with
, this function returns
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
. For example:
(make-rgb 0.0s0 1.0s0 0.0s0)
(make-hsv 1.2s0 0.5s0 0.9s0)
To create a color spec with an alpha component using the above constructors, pass an extra optional argument. For example this specifies green with 40% transparency:
(make-rgb 0.0s0 1.0s0 0.0s0 0.6s0)
You can also make a transparent color using
(color-with-alpha color-spec 0.8s0)
Note that the alpha component is only supported on Cocoa and Windows.
can be used to test for color-spec objects. The function
returns the model in which a color-spec object has been defined.
CAPI User Guide (Macintosh version) - 30 Aug 2011