| Previous Topic | Next Topic | Contents | Features |
The QPALET INITIALIZE command defines a new set of basic colors. A name and the RGB (Red-Green-Blue) components are specified for each color defined. The RGB components must be between 0 (off) and 1 (full intensity). The file color.sab in the examples directory illustrates color definitions by this method:
QPALET INITIALIZE
WHITE 1 1 1
RED 1 0 0
Green 0 1 0
BLUE 0 0 1YELLOW 1 1 0
BROWN .7 .5 .3
orange 1 .6 0PINK 1 .8 .8
MAGENTA 1 0 1
AquaBlue 0 1 1
BLACK .3 .3 .3
.
QPALET ERROR RED
QPALET BACKG blue
QPALET MATERIAL -1 GREEN
Up to 100 basic colors may be created; this example creates 11. Note that the case of the color names does not matter since all input is mapped to upper case (nor does the case in color references). In pseudocolor mode (8 color planes or less), Sabrina will automatically assign the maximum number of levels of shading NShade possible for each color. The values of NShade and NColor may be overridden with QPALET SET. Following color definitions with QPALET INITIALIZE, the background and error colors must be set with QPALET BACKGROUND and QPALET ERROR, respectively, and the default color for opaque zones must be specified. The latter is accomplished in the example by setting the color of all zones with a nonzero material number to the desired default. The cell color assignment affects current cells; cells defined later will be assigned the original default color index.
If a QPALET MATERIAL command is given before any cell definitions exist, Sabrina will complain because no materials have been defined. In addition to color.sab, the directory also contains colors_many.sab, which defines 16 colors, and reset_colors.sab, which defines the original (8 plane) 8 colors.
The 8 and 16 default colors can also be initialized with the commands QPALET RESET 8 and QPALET RESET 16 and with the Load Default 8 / 16 Colors buttons on the Graphics menu.