WebGLRenderingContext: blendColor() 方法
注意:此功能在 Web Workers 中可用。
WebGLRenderingContext.blendColor() 方法是 WebGL API 的一部分,用於設定源和目標混合因子。
語法
js
blendColor(red, green, blue, alpha)
引數
返回值
無(undefined)。
示例
要設定混合顏色,請使用
js
gl.blendColor(0, 0.5, 1, 1);
要獲取混合顏色,請查詢 BLEND_COLOR 常量,它將返回一個 Float32Array。
js
gl.getParameter(gl.BLEND_COLOR);
// Float32Array[0, 0.5, 1, 1]
規範
| 規範 |
|---|
| WebGL 規範 # 5.14.3 |
瀏覽器相容性
載入中…