CLS+in+Graphics

CLS
The graphic CLS statement should not be confused with the general CLS statement.

A graphic object can be cleared to a blank rectangle with the **CLS** statement. There are three possibilities for the CLS statement.


 * 1) handle CLS(["color"] | [r, g, b]) - Clear the graphics area to white, or to named color, or to an RBG color

Clear to default white:
 * 1) handle CLS

Clear to named color, which is a string:
 * 1) handle CLS("red")

Clear to RGB color, which is three values (0-255) separated by commas:
 * 1) handle CLS(255,0,128)

Here is a demo that creates a graphic object, draws a circle, then causes the graphic to be displayed on the web page. It then uses CLS to clear the graphic to a named color, then again to the default white, then again to an RGB color. See also Color for more information on using colors in Run BASIC graphics.

code format="vbnet" 'create a graphic object graphic #g, 300, 300 'place the drawing pen at 100,100 'draw a circle with radius 75 'add graphic to web page render #g
 * 1) g place(100,100)
 * 1) g circle(75)

'clear the screen to named color render #g
 * 1) g cls("chartreuse")

'clear the screen to default white render #g
 * 1) g cls

'clear the screen to RGB color render #g
 * 1) g cls(214, 120, 72)

code