Chapters: 1: Introduction 2: Simple example 3: Invocation 4: Finer Control 5: X-Y Plots 6: Contour Plots 7: Image Plots 8: Examples 9: Gri Commands 10: Programming 11: Environment 12: Emacs Mode 13: History 14: Installation 15: Gri Bugs 16: Test Suite 17: Gri in Press 18: Acknowledgments 19: License Indices: Concepts Commands Variables |
4.9: Colour of ink in penThe darkness of the ``pen'' used in drawing commands (for either lines or for text) is set by `set graylevel .brightness. '. A brightness
value of 0 corresponds to black ink, and a brightness value of 1
corresponds to white ink. Values outside this range are clipped to the
nearer endpoint. Values inside this range choose a proportional
graylevel in between; for example, `set graylevel 0.5 ' gives a 50
percent gray tone.
The graylevel applies to text as well as lines. Often you'll want to draw a gray line and a black label beside it, or you'll want to set a graylevel temporarily. Here's how to do it:
The color of the "pen" may be set to any value you can describe with an RGB (red, green, blue) or HSB (hue, saturation, brightness) specification, or a color name. This pen color applies to everything, even text.
The ` Set the pen color to the indicated name. There are two types of names: hexadecimal-triplet names and English names. Hexadecimal-triplet names are of a form often used in web-pages. They consist of exactly 6 characters, which are divided by Gri into three sets of two characters, specifying the red component, the green component, and the blue component of the color, respectively. These components are in hexadecimal notation, i.e. ranging from 00 to FF, indicating values from 0 to 255. For example,
sets a pastel blue color, almost the color of a robin's egg. The English colors are written simply in the form
where the color is from the following list. (Gri requires that you use the exact form shown, including the capitilization.) The color mixes are identical to those used in X11.
To get more colors than those provided in the above list, use the
`
You should do a test case for your printer to see which colors you find
most to your liking. You'll want to pick colors that look different
from each other. In some cases you might want to avoid dithered colors,
since they look too broken on really thin lines. For example, on my
printer I like the following colors: `
The `
This command sets the color using the red-green-blue color model. If
you are familiar with how colors add (e.g. red plus green yields
yellow), then you might like this, but most people find it easier to use
the `
Set the individual color components as follows. The numbers
`
The `
In this color model, the color ("hue") is specified with a single
parameter. Many people find this easier than using the corresponding
`
Set the individual color components as follows. The numbers
` Hue, saturation, and brightness values are all clipped to the range 0 to 1. EXAMPLES:
|