WebGL Wiki
No edit summary
No edit summary
Line 16: Line 16:
 
:// The color black, fully opaque, will be used when the color buffers are cleared
 
:// The color black, fully opaque, will be used when the color buffers are cleared
 
:gl.clearColor(0.0, 0.0, 0.0, 1.0);
 
:gl.clearColor(0.0, 0.0, 0.0, 1.0);
  +
  +
==Se also==
  +
*[[clear]]
  +
*[[clearDepth]]
  +
*[[clearStencil]]
 
[[Category:Methods]]
 
[[Category:Methods]]

Revision as of 18:11, 30 June 2011

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);

Se also