Previous Next


                                          264
CHAPTER 4                                                                      Graphics



Example 4.10

   [ /Indexed
         /DeviceRGB
         255
         < 000000 FF0000 00FF00 0000FF B57342 … >
   ]

The example shows only the first five color values in the lookup string; in all, there
should be 256 color values and the string should be 768 bytes long. Having
established this color space, the program can now specify colors as single-compo-
nent values in the range 0 to 255. For example, a color value of 4 selects an RGB
color whose components are coded as the hexadecimal integers B5, 73, and 42.
Dividing these by 255 and scaling the results to the range 0.0 to 1.0 yields a color
with red, green, and blue components of 0.710, 0.451, and 0.259, respectively.

Although an Indexed color space is useful mainly for images, index values can
also be used with the color selection operators SC, SCN, sc, and scn. For example:

   123 sc

selects the same color as does an image sample value of 123. The index value
should be an integer in the range 0 to hival. If the value is a real number, it is
rounded to the nearest integer; if it is outside the range 0 to hival, it is adjusted to
the nearest value within that range.


Separation Color Spaces

Color output devices produce full color by combining primary or process
colorants in varying amounts. On an additive color device such as a display, the
primary colorants consist of red, green, and blue phosphors; on a subtractive de-
vice such as a printer, they typically consist of cyan, magenta, yellow, and some-
times black inks. In addition, some devices can apply special colorants, often
called spot colorants, to produce effects that cannot be achieved with the standard
process colorants alone. Examples include metallic and fluorescent colors and
special textures.

When printing a page, most devices produce a single composite page on which all
process colorants (and spot colorants, if any) are combined. However, some de-
vices, such as imagesetters, produce a separate, monochromatic rendition of the
page, called a separation, for each colorant. When the separations are later com-

Previous Next