|
red - red component, 0 to 255 green - green component, 0 to 255 blue - blue component, 0 to 255 |
|
Sets the colour Cls clears the screen to. Fresh after Graphics the cls colour is black (0,0,0). Set it once - say ClsColor 64,128,255 for a sky blue - and every Cls from then on fills with that colour. Handy for flat-colour backdrops so you do not have to draw a background rectangle each frame, or for a quick full-screen flash effect (set, Cls, set back). The setting is global rather than per buffer, and a new Graphics call resets it to black. See also: Cls, Color. |
; ClsColor Example
; ----------------
Graphics 640,480,0,2
SetBuffer BackBuffer()
red=0
green=64
blue=128
x#=0
While Not KeyDown(1)
; R / G / B keys cycle each component of the clear colour
If KeyHit(19) Then red=(red+32) Mod 256
If KeyHit(34) Then green=(green+32) Mod 256
If KeyHit(48) Then blue=(blue+32) Mod 256
; ClsColor sets the colour Cls uses to wipe the screen
ClsColor red,green,blue
Cls
; A bouncing ball so we can see drawing on top of the cleared screen
x=x+3
If x>640 Then x=-40
Color 255,255,255
Oval x,300,40,40,1
Text 0,0,"R / G / B: cycle clear colour components Esc: exit"
Text 0,20,"ClsColor "+red+","+green+","+blue
Flip
Wend
End