The LispWorks Color System allows applications to use keyword symbols as aliases for colors in Graphics Ports drawing functions. They can also be used for backgrounds and foregrounds of windows and CAPI objects.
For example, the call
(gp:draw-line my-port x1 y1 x2 y2
uses the keyword symbol
for the color of the line.
Colors are looked up in a color database. The LispWorks image is delivered with a large color database already loaded (approximately 660 entries.) The color database contains color-specs which define the colors in terms of a standard color model. When the drawing function is executed, the color-spec is converted into a colormap index (or "pixel" value).
The LispWorks Color System has facilities for:
It is accessible from the
package, and all symbols mentioned in this chapter are assumed to be external to this package unless otherwise stated. You can qualify them all explicitly in your code, for example
However it is more convenient to create a package which has the
package on its package-use-list:
(:use "COLOR" "CAPI")
This creates a package in which all the
symbols (and for convenience,
as well) are accessible. To run the examples in this chapter, evaluate the form above and then:
The color-models available by default are RGB, HSV and GRAY.
CAPI User Guide (Unix version) - 30 Aug 2011