Back: 3.2.4 palette Forward: 3.3 Managing a display list     FastBack: 3. Graphics Up: 3.2 Plot limits and relatives FastForward: 4. Embedding Compiled Routines Inside Yorick         Top: Yorick: An Interpreted Language Contents: Table of Contents     About: About This Document

3.2.5 Color model

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.


Back: 3.2.4 palette Forward: 3.3 Managing a display list     FastBack: 3. Graphics Up: 3.2 Plot limits and relatives FastForward: 4. Embedding Compiled Routines Inside Yorick         Top: Yorick: An Interpreted Language Contents: Table of Contents     About: About This Document