WebGL API 的 WebGLRenderingContext.blendColor()
方法用于设置源和目标混合因子。
语法
void gl.blendColor(red, green, blue, alpha);
参数
返回值
None.
示例
要设置混合颜色,请使用:
gl.blendColor(0, 0.5, 1, 1);
要获得混合颜色,请查询返回 Float32Array
的 BLEND_COLOR 常量。
gl.getParameter(gl.BLEND_COLOR);
// Float32Array[0, 0.5, 1, 1]
规范
Specification | Status | Comment |
---|---|---|
WebGL 1.0 blendColor |
Recommendation | Initial definition. |
OpenGL ES 2.0 glBlendColor |
Standard | Man page of the OpenGL API. |
The compatibility table in 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.