GCOL

Dither patterns from colour 0 (black) to 15 (white).

GCOL sets the graphics foreground or background colour, as well as specifying how the colour is to be plotted on the screen. It can be plotted directly, ANDed, ORed or Exclusive-ORed with the colour already there, or the existing colour can be inverted.

The first value passed to GCOL determines the plotting mode and the second the graphics foreground or background colour. The plotting modes are as follows:

Code Operation
0 Plot the colour specified.
1 OR the specified colour with the colour that is already there.
2 AND the specified colour with the colour that is already there.
3 Exclusive-OR the specified colour with the colour that is already there.
4 Invert the colour that is already there.

The second value determines the colour. If the value is less than 128, the graphics foreground colour is set to that value. If the number is 128 or greater, the graphics background colour is set to value-128.

If GCOL is only followed by a single value then the foreground or background colour is set and the plot mode is reset to 0, plot.

GCOL 1,64 : REM Set plot mode to OR, foreground colour to 64.
GCOL 255  : REM Set plot mode to plot, background colour to 127.

Generally, you will not notice a change in the graphics background colour until you clear the graphics screen with a CLG command.

GCOL disables any fill pattern set by the GCOLPAT statement.

Syntax

GCOL [<numeric>,]<numeric>

Associated Keywords