WebGLRenderingContext: drawingBufferColorSpace プロパティ

Baseline 2024
Newly available

Since October 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

WebGLRenderingContext.drawingBufferColorSpace プロパティは、 WebGL 描画バッファーの色空間を指定します。既定値 (srgb) の他に、 display-p3 色空間も使用することができます。

テクスチャの色空間を指定するには WebGLRenderingContext.unpackColorSpace を参照してください。

このプロパティは以下の値を採ることができます。

無効な値を指定した場合、 drawingBufferColorSpace の値は変更されません。

描画バッファー色空間を、 Display P3 の赤を描画するように設定

js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
gl.drawingBufferColorSpace = "display-p3";
gl.clearColor(1, 0, 0, 1);
gl.clear(glP3.COLOR_BUFFER_BIT);

仕様書

Specification
WebGL Specification
# DOM-WebGLRenderingContext-drawingBufferColorSpace

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
drawingBufferColorSpace

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Has more compatibility info.

関連情報