TheSET PENstatement changes the color map values used for each available pen number. A color may be specified in either RGB or HSL color space (seeCOLORfor an explanation about RGB and HSL color spaces). Redefine multiple pens using the array specifier or redefine individual pens by specifying one HSL or RGB color value. In either case, the pen-number specifies the first entry in the color map to be defined. The pen-number is a numeric expression which is rounded to an integer and should be in the range 0 to n-1, where n is the number of colors.
The closest possible color will be used if the computer display cannot display the color you select. When drawing an area in a certain color, it may be possible to produce the color more accurately by specifyingSET PENfollowed byAREA PEN, rather than specifyingAREA COLORorAREA INTENSITY.
Any pixels already drawn with the specified pen are changed to the new. AllSET PENstatements take effect immediately upon execution. The effects of allSET PENstatements last until the nextSET PENstatement of the same type, or untilGINITorQUIT. In cases where dithering is used, changing the color map changes the colors available to the dithering process.
Array
If an array is used to set more than one pen, the array must be 2-dimensional and have 3 columns. The number of rows determines the number of pens set. For example,