WebGLRenderingContext.blendColor()
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.blendColor()
方法用于设置源和目标混合因子。
语法
void gl.blendColor(red, green, blue, alpha);
参数
返回值
None.
示例
要设置混合颜色,请使用:
js
gl.blendColor(0, 0.5, 1, 1);
要获得混合颜色,请查询返回 Float32Array
的 BLEND_COLOR 常量。
js
gl.getParameter(gl.BLEND_COLOR);
// Float32Array[0, 0.5, 1, 1]
规范
Specification |
---|
WebGL Specification # 5.14.3 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
blendColor |
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.