The line drawing primitives plg, pldj, plm, plc, and plv accept a color= keyword. You can use an index into the current palette, in which case the color of the line becomes dependent on the palette. However, you can also choose one of ten colors which are always defined, and which do not change when the palette changes. For example,
plg, sin(theta),cos(theta), color="red" |
draws a red circle (assuming theta runs from zero to two pi). The colors you can specify in this way are: "black", "white", "red", "green", "blue", "cyan", "magenta", "yellow", "fg", and "bg".
Black and white, and the primary and secondary colors need no further explanation. But "fg" stands for foreground and "bg" for background. The default color of all curves is "fg"; the color of the blank page or screen is "bg". These colors are intentionally indefinite; unlike the others, they may differ on your screen and in print. By default, "fg" is black and "bg" is white. If you use the X window system, you can change these defaults by setting X resources. For example, set
Gist*foreground: white Gist*background: black |
to make Yorick draw in reversed polarity on your screen (white lines on a black background). (The X utility xrdb is the easiest way to set X resources for your screen.)
As of yorick 1.5, the color may also be an array of three values (red, green, blue), with 0 minimum intensity and 255 maximum. If you specify a true color on a display which only supports pseudocolor, that window will switch irreversibly to a 5x9x5 color cube, which causes a significant degradation in rendering quality with smooth palettes.