Previous Next


                                        298
CHAPTER 4                                                                   Graphics



Several features of Example 4.23 are noteworthy:

• The three circles and the triangle are painted with the same pattern. The pat-
  tern cells align, even though the circles and triangle are not aligned with re-
  spect to the pattern cell. For example, the position of the blue diamonds varies
  relative to the three circles.
• The pattern cell does not completely cover the tile: it leaves the spaces between
  the glyphs unpainted. When the tiling pattern is used as a color, the existing
  background (the yellow rectangle) shows through these unpainted areas.


Uncolored Tiling Patterns

An uncolored tiling pattern is a pattern that has no inherent color: the color must
be specified separately whenever the pattern is used. It provides a way to tile dif-
ferent regions of the page with pattern cells having the same shape but different
colors. This type of pattern is identified by a pattern type of 1 and a paint type of
2 in the pattern dictionary. The pattern’s content stream does not explicitly speci-
fy any colors; it can paint an image mask (see “Stencil Masking” on page 350) but
no other kind of image.

A Pattern color space representing an uncolored tiling pattern requires a parame-
ter: an object identifying the underlying color space in which the actual color of
the pattern is to be specified. The underlying color space is given as the second
element of the array that defines the Pattern color space. For example, the array

   [ /Pattern /DeviceRGB ]

defines a Pattern color space with DeviceRGB as its underlying color space.

Note: The underlying color space cannot be another Pattern color space.

Operands supplied to the SCN or scn operator in such a color space must include
a color value in the underlying color space, specified by one or more numeric
color components, as well as the name of a pattern object representing an un-
colored tiling pattern. For example, if the current resource dictionary (see Section
3.7.2, “Resource Dictionaries”) defines Cs3 as the name of a ColorSpace resource

Previous Next