12.5.9. Color

A color shall always be specified with respect to a color-space.

(color-space string arg ...)

Returns an object of type color-space. The string specifies a public identifier identifying the color-space family. The remaining arguments specify parameters to the color-space family. The type and number of the remaining arguments depend on the color-space family as described below.

(color-space? obj)
Returns #t if obj is a color-space, and otherwise returns #f.
(color color-space arg ...)

Returns an object of type color. color-space is the color-space relative to which color is to be specified. The type and number of the remaining arguments depend on the color-space family to which color-space belongs. If no arguments other than color-space are specified, then the default color in color-space is returned.

NOTE 53: This is normally black.

(color? obj)
Returns #t if obj is a color, and otherwise returns #f.

This International Standard defines the following color-space families:

The semantics of each of these color-space families is that of the corresponding color-space family in ISO/IEC 10180. The additional arguments required by color-space when one of these color-space families is specified as the first argument are determined by the parameters of the corresponding Color-Space Object in ISO/IEC 10180. When the ISO/IEC 10180 Color-Space Object has no parameters, color-space takes no additional arguments. When the ISO/IEC 10180 Color-Space Object has a single parameter of type Dictionary, color-space accepts a keyword argument for each key allowed in the Dictionary. The name of each keyword is derived from the name of the Dictionary key by inserting a hyphen before each upper-case letter in the name that is not the first letter and that is followed by a lower-case letter, and by then mapping all characters to lower-case. The type of each keyword argument shall be determined by the type of the corresponding Dictionary value:

The number and type of the additional arguments required by the color procedure when the first argument is a color-space that belongs to one of these families shall be determined by the number and type of the argument required by the ISO/IEC 10180 SetColor operator to specify a color in the corresponding ISO/IEC 10180 color-space. These additional arguments are all required arguments (not keyword arguments). Their types are determined from the ISO/IEC 10180 types in the same manner as the arguments for color-space. The default color for each color-space is determined by the value that ISO/IEC 10180 defines the CurrentColor Graphics State Variable to have immediately after execution of the SetColorSpace operator for the corresponding ISO/IEC 10180 color-space.

NOTE 54: A color specified in a color-space with a procedure argument may be transformed in a device-independent manner to a color specified in a color-space without any procedure arguments. There is, therefore, no need when implementing the style language with output to an ISO/IEC 10180 device to be able to compile an arbitrary expression into the language defined in ISO/IEC 10180.