Use the keyword COLOR to specify a color in the HSL (Hue, Saturation, Lightness) color space. The HSL color space is designed to be intuitive and follows the model of mixing paints. An artist preparing a color for a painting first selects a hue (pure color pigment). He may then add black or white paint to arrive at the desired color. Adding white serves to wash out the color. In scientific terms, we say this affects the "saturation" of the color. The artist may then adjust the brightness by adding black paint. This affects the amount of light reflected by the pigment. We call this the luminosity.
Saturation ranges from zero (white) to one (pure color - no added white). Luminosity ranges from zero (black) to one (pure color - no added black). Hue ranges from zero to one. The following table gives an indication of where several colors occur in that range:
Hue
Value
Red
.000
Yellow
.167
Green
.333
Cyan
.500
Blue
.667
Magenta
.833
Red
1.00
Specifying a Color using the RGB system
Use the keyword INTENSITY to specify a color using the RGB (Red, Green, Blue) color space. The RGB color space is designed to match the way in which our eyes work and in turn, the way in which television and computer displays are designed. The display has three color guns: Red, Green and Blue. By specifying a number in the range zero (corresponding to zero intensity) to one (corresponding to maximum intensity) for each of the three guns, you can uniquely define all the colors which can be produced by that display.
Pen Numbers
A computer display system is limited in the number of different colors it can display at the same time. If N is the number of different colors which can be displayed simultaneously, then legal pen numbers are the integers 0 to N-1.
Drawing Mode Table
The writing mode of the pen is specified by the current drawing mode and the sign of the pen number. GESCAPECRT,4 is used to change to normal drawing mode. GESCAPECRT,5 is used to change to alternate drawing mode. The following table defines the different writing modes available. P is a positive pen number, X is the present value of a pixel.
Statement
GESCAPE CRT,4
Normal
GESCAPE CRT,5
Alternate
PEN P
P
BINIOR(X,P)
AREA PEN P
P
BINIOR(X,P)
PEN 0
BINCMP(X)*
0
AREA PEN 0
0
0
PEN -P
BINAND(X,BINCMP(P))
BINEOR(X,P)
AREA PEN -P
BINAND(X,BINCMP(P))
BINAND(X,BINCMP(P))
*PEN 0 in Normal Drawing Mode will do BINCMP(X) in non-color map mode and 0 in COLOR MAP mode.
Pen Numbers
The SET PEN statement explains pen color assignments. The following table gives the default color to pen assignments.