ClearColor

Definition
The clearColor method specifies the red, green, blue, and alpha values used by clear to clear the color buffers.

Syntax

 * gl.clearColor(red, green, blue, alpha)

Parameters

 * red: floating-point number between 0.0 and 1.0, the default value is 0.0
 * green: floating-point number between 0.0 and 1.0, the default value is 0.0
 * blue: floating-point number between 0.0 and 1.0, the default value is 0.0
 * alpha: floating-point number between 0.0 and 1.0, the default value is 0.0

Examples

 * // The color black, fully opaque, will be used when the color buffers are cleared
 * gl.clearColor(0.0, 0.0, 0.0, 1.0);


 * // The color yellow, 50% opaque, will be used when the color buffers are cleared
 * gl.clearColor(1.0, 1.0, 0.0, 0.5);