The SET PEN statement defines part or all of the color map. A color may be specified in either the RGB or the HSL color space by using the INTENSITY or the COLOR keywords respectively. You may redefine an individual pen by specifying one HSL or RGB color value or multiple pens by specifying an array. In either case, the pen-number specifies the first entry in the color map to be defined. For example:
SET PEN pen-number COLOR h, s, l
SET PEN pen-number COLOR numeric-array(*)
SET PEN pen-number INTENSITY r, g, b
SET PEN pen-number INTENSITY numeric-array(*)
The pen-number should be in the range 0 to n-1, where n is the number of colors supported by the map. The closest possible color will be used if the computer display cannot display the color you select.
Immediate Effect. Any pixels already drawn with the specified pen are changed to the new color. All SET PEN statements take effect immediately upon execution. The effects of all SET PEN statements last until the next SET PEN statement of the same pen, or until GINIT, PLOTTER IS, SEPARATE/MERGE ALPHA, or QUIT. In cases where dithering is used, changing the color map changes the colors available to the dithering process, and changes the colors of areas already drawn with dithering that use that particular pen as part of the dither pattern.
In addition to the PEN and SET PEN statements the GESCAPE statement can affect the graphics color.