*COLOR (KEYIN and DISPLAY)
*COLOR=[{n} | {*color}]
This list control provides access to the color attributes. If Datapoint compatibility mode is enabled, the *COLOR control behaves as the *FGCOLOR control.
{n} may be a decimal value, an Expression, or a numeric variable between zero (0) and 255. The various colors are defined by the following color map. The foreground colors may be in bold mode by adding eight (8) to the foreground value. The entire character may be made to blink by adding 128 to the color value. The actual color value is derived by adding the corresponding color values for foreground, background, bold and blinking.
Note the following:
It is not possible on most monitors to display YELLOW unless the BOLD value is added to the BROWN value.
Underline and Blink support is not saved or restored with the SCRNSAVE and SCRNRESTORE instructions or the *CRTON list control if the runtime is using the default eight bit character attribute size. Switching the attribute size to sixteen bits by way of either this control or the PLB_SAVECHARSIZE runtime key word permits underline and blink attributes to be saved and restored.
The color values may be given as any one of the color keywords defined in the {*color} section. If this form is used, the background color is always set to black. For example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Each of these DISPLAY statements sets the foreground color to red and the background color to black.
|
Color |
Foreground |
Background |
|
BLACK |
0 |
0 |
|
BLUE |
1 |
16 |
|
GREEN |
2 |
32 |
|
CYAN |
3 |
48 |
|
RED |
4 |
64 |
|
MAGENTA |
5 |
80 |
|
BROWN or YELLOW |
6 |
96 |
|
WHITE |
7 |
112 |
See Also: List Controls (KEYIN and DISPLAY), List Controls (KEYIN), DISPLAY, KEYIN
![]() |