.BG
.VE $Header: /usr/s/current/s/.help/RCS/ctable,v 1.3 85/08/09 14:59:16 rab Exp $
.FN ctable
.TL
ctable: Create Color Table for Use on the AED512
.CS
ctable(table1, spec1, table2, spec2, ...)
.PP
.AG tablei
optional numeric matrix with 4 columns.
Each row
gives a color number
and its associated 
hue, lightness, and saturation.
.AG speci
optional character vector, in which each element 
defines one or more colors.
The syntax for these strings is
`nrange,hrange[,lrange[,srange]]'
where each range is either a single non-negative integer
or a colon-separated pair of such integers.
`nrange' specifies the range of colors to be defined
and `hrange', `lrange' and `srange' define respectively the
hues, lightnesses and saturations to use in the
definitions.
`nrange' fixes how many colors will be defined and the
values implied by `hrange', `lrange' and `srange' are then determined
accordingly.
When any of `hrange', `lrange' or `srange' is a single number, this
value is used repeatedly in the generated definitions.
Certain symbolic names are recognized in `hrange' in
place of numbers (see below).
.RT
matrix with 4 columns, containing all the color
definitions occurring in the arguments, in the same
form as `tablei' above; if more than one definition is given for a
particular color number, the last one is used.
.SH COMMENTS
Valid color numbers range from 0 to 127.
.PP
Hues are placed around the perimeter
of a circle with blue at 0 degrees, red at 120 degrees
and green at 240 degrees.
Intermediate values are magenta (60), orange (150),
yellow (180) and cyan (300).
In each color definition, the hue value is interpreted as an
angle in degrees around this circle.
In a `speci' argument the particular colors just mentioned
may be specified by giving their name in place of their
angle around the color circle.
Thus "12,red" defines color 12 as red and "20:30,red:yellow"
defines colors 20 through 30 as a smooth transition from red
to yellow.
These specifications are just alternate forms for "12,120"
and "20:30,120:180", respectively.
If the two values (or names) specified in
`hrange' are equal, then an entire circuit around the circle
is generated rather than a simple repetition of the value.
Thus "2:10,blue:blue" specifies colors 2 through 10 as a
complete spectrum beginning and ending with blue.
.PP
Lightness is a numerical description of the gray value of the
color and ranges from 0 (black) to 100 (white).
The default value for lightness is 50.
.PP
Saturation is a measure of the intensity of the given
hue and ranges from 0 (no intensity--gray) to 100 (full
intensity).
Its default value is 100.

In addition to the symbolic color names mentioned above,
three others are available in the `hrange' position.
"white" changes the default lightness to 100, "black" changes
it to 0, and "gray" to "0:100".
.PP
.EX
mycol <- ctable("10:50,blue:red,50,60")
      # set up a range of pastel colors from blue to red
color(mycol)    # set up the AED color map
mycol <- ctable(mycol,"60:70,gray")
      # add a gray scale
.KW color
.KW plot*
.KW device*
.WR
