next up previous contents index
Next: Typography Up: Drawing Attributes Previous: Path Width and Style   Contents   Index

Color and Filling

An ePiX output file achieves color through the pstcol style, an amalgamation of color and PSTricks styles. There are three available color models: rgb, cmyk (cyan, magenta, yellow, and black), and named (primary colors only). An rgb color is specified by three numbers between 0 (no color) and 1 (full saturation), each of which represents the density of a primary color (red, green, and blue respectively). A cmyk color is similarly set by giving four densities. Finally, a primary color (r, g, or b; c, m, or y; black and white) may be specified by name, with an optional density.

  rgb(1, 0, 1);  // magenta
  cmyk(0,1,0,0); // same thing
  magenta();     // method III
  rgb(1, 0.7, 0.7); // light red
  rgb(0.4, 0, 0);   // dark red
  red(0.4);         // same thing
Like all parameters, color densities can depend on variables. Values that lie outside the interval $ [0,1]$ are ``clipped''; for example, rgb(1.4,-0.05,2) is also magenta.

The fill() command causes closed paths to be gray-shaded, using PostScript specials. The depth of gray ranges from 0 (white) to 1 (black), and defaults to $ 0.3$. The command gray(0.4) sets the depth to $ 0.4$. Filling is deactivated by the command fill(false). The order of filled objects in the source file is significant, because ePiX writes its output in the same order, and PostScript has no transparency. Layering, hidden object removal, and color shading are discussed in Chapters 3 and 4.


next up previous contents index
Next: Typography Up: Drawing Attributes Previous: Path Width and Style   Contents   Index
Andrew D. Hwang 2004-09-04