WebGLRenderingContext.clearColor()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebGL API の WebGLRenderingContext.clearColor()
メソッドは、カラーバッファーの消去に使われる色の値を指定します。
この指定は clear()
メソッドを呼んだときに使用される色です。値は 0 から 1 に丸められます。
構文
void gl.clearColor(red, green, blue, alpha);
引数
返り値
ありません。
例
js
gl.clearColor(1, 0.5, 0.5, 3);
現在の消去に使われる色を取得するには、COLOR_CLEAR_VALUE
定数で問い合わせると Float32Array
を返します。
js
gl.getParameter(gl.COLOR_CLEAR_VALUE);
// Float32Array[1, 0.5, 0.5, 1]
仕様策定状況
Specification |
---|
WebGL Specification # 5.14.3 |
ブラウザーの対応
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
clearColor |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.