Previous Next


                                       243
SECTION 4.5                                                             Color Spaces



The CS and SC operators select the current stroking color space and current
stroking color separately; RG sets them in combination. (The cs, sc, and rg opera-
tors perform the same functions for nonstroking operations.) Setting either cur-
rent color space to DeviceRGB initializes the red, green, and blue components of
the corresponding current color to 0.0.


DeviceCMYK Color Space

The DeviceCMYK color space allows colors to be specified according to the sub-
tractive CMYK (cyan-magenta-yellow-black) model typical of printers and other
paper-based output devices. In theory, each of the three standard process colorants
used in printing (cyan, magenta, and yellow) absorbs one of the additive primary
colors (red, green, and blue, respectively). Black, a fourth standard process colo-
rant, absorbs all of the additive primaries in equal amounts. The four components
in a DeviceCMYK color value represent the concentrations of these process colo-
rants. Each component is specified by a number in the range 0.0 to 1.0, where 0.0
denotes the complete absence of a process colorant (that is, absorbs none of the
corresponding additive primary) and 1.0 denotes maximum concentration (ab-
sorbs as much as possible of the additive primary). Note that the sense of these
numbers is opposite to that of RGB color components.

Example 4.4 shows alternative ways to select the DeviceCMYK color space and a
specific color within that space for stroking operations.

Example 4.4

  /DeviceCMYK CS                         % Set DeviceCMYK color space
  cyan magenta yellow black SC           % Set color

  cyan magenta yellow black K            % Set both in one operation

The CS and SC operators select the current stroking color space and current strok-
ing color separately; K sets them in combination. (The cs, sc, and k operators per-
form the same functions for nonstroking operations.) Setting either current color
space to DeviceCMYK initializes the cyan, magenta, and yellow components of the
corresponding current color to 0.0 and the black component to 1.0.

Previous Next