Difference between revisions of "GCOL"

From BeebWiki
Jump to: navigation, search
m (1 revision)
m (Description)
Line 49: Line 49:
  
 
4 invert the colour already there.
 
4 invert the colour already there.
 +
 +
The GXR and Master added 16*n+k for n=1-4. Arthur added actions 5-7, 8-15, and 16*n+k with n=5.
  
 
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.
 
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.
  
 
In the two-argument form it is simply a veneer for <code>[[VDU 18]]</code>.
 
In the two-argument form it is simply a veneer for <code>[[VDU 18]]</code>.

Revision as of 16:07, 30 August 2019

GCOL is used to select the logical colours used by graphics statements.

GCOL
Availability Present in all original versions of BBC BASIC.
Syntax BASIC I-IV GCOL <numeric>,<numeric>
BASIC V GCOL <numeric>,<numeric> [TINT <numeric>]
Token (hex) BASIC I-V E6 (statement)
Description BASIC I-V If bit 7 of the second <numeric> is 0 then GCOL sets the foreground graphics paint mode to the first <numeric> and the foreground graphics colour to the second <numeric> modulo 128.
If bit 7 of the second <numeric> is 1 then GCOL sets the colour and paint mode of background graphics instead.
The current contents of the screen are not affected.
In BASIC V the TINT argument sets the foreground or background tint.
Associated keywords CLG, CLS, COLOUR, MODE, PLOT

Description

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 Exclusive-OR the colour with the colour already there

4 invert the colour already there.

The GXR and Master added 16*n+k for n=1-4. Arthur added actions 5-7, 8-15, and 16*n+k with n=5.

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.

In the two-argument form it is simply a veneer for VDU 18.