If I put a clearcolor with zero alpha, I don't understand why we then see the color given in CSS of the canvas rather than the CSS color of the body. On canvas, what is the difference between WebGLRenderingContext.clearColor() and background-color?
const gl = document.getElementById("c").getContext("webgl", {
premultipliedAlpha: false,
});
gl.clearColor(0, 1, 0, 0);
gl.clear(gl.COLOR_BUFFER_BIT);
canvas {
background-color: rgba(255,0,0,1);
}
body {
background-color: rgba(0,0,255,1);
}
<canvas id="c"></canvas>