GCOL is used to select the logical colours used by graphics statements.
|Availability||Present in all original versions of BBC BASIC.|
|Syntax||BASIC I-IV|| |
|BASIC V|| |
|Token (hex)||BASIC I-V|| |
|Description||BASIC I-V|| If bit 7 of the second <numeric> is 0
If bit 7 of the second <numeric> is 1 then
The current contents of the screen are not affected.
In BASIC V the
|Associated keywords|| |
This statement sets the colour to be used by all subsequent graphics operations. It can set the foreground and background graphics colours. It also specifies how the colour is to be placed on the screen.
The first number specifies the mode of action.
- 0 plot the specified colour
- 1 OR the colour with the colour already there
- 2 AND the colour with the colour already there
- 3 XOR (exclusive-OR) the colour with the colour already there
- 4 NOT (invert) the colour already there
- 5 no change to colour already there (not initially documented)
- 6 clear the colour - set it to colour 0 (not initially documented)
- 7 various actions resulting from a table overflow
With the Graphics Extension ROM, Master and later:
- 16*n+k - select fill pattern n
On Arthur and later:
- 6 sets the pixel to (NOT colour AND the colour already there)
- 7 sets the pixel to (NOT colour OR the colour already there)
- 8+k - fill pattern uses a transparent background
- 16*5+k - select a fill pattern made from all four fill patterns in a block
The second number specifies the logical colour. If the number is less than 128 then it defines the graphics foreground colour. If the number is greater than 127 then it defines the graphics background colour.
GCOL simply sends
VDU 18,action,colour. Some versions of
GCOL <colour> which sends VDU 18,0,colour.
The BBC VDU driver does no range checking on the GCOL action, so using out-of-range actions can cause odd effects.