Skip to content

Commit dfa43ed

Browse files
committed
Premultiply in webgl clear color
1 parent c78fc3e commit dfa43ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webgl/p5.RendererGL.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ p5.RendererGL.prototype.background = function(...args) {
589589
const _g = _col.levels[1] / 255;
590590
const _b = _col.levels[2] / 255;
591591
const _a = _col.levels[3] / 255;
592-
this.clear(_r * _a, _g * _a, _b * _a, _a);
592+
this.clear(_r, _g, _b, _a);
593593
};
594594

595595
//////////////////////////////////////////////
@@ -895,7 +895,7 @@ p5.RendererGL.prototype.clear = function(...args) {
895895
const _b = args[2] || 0;
896896
const _a = args[3] || 0;
897897

898-
this.GL.clearColor(_r, _g, _b, _a);
898+
this.GL.clearColor(_r * _a, _g * _a, _b * _a, _a);
899899
this.GL.clearDepth(1);
900900
this.GL.clear(this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT);
901901
};

0 commit comments

Comments
 (0)