I was messing around with the available canvas context flags for my WebGL application, and I noticed that setting desynchronized to true along with alpha to false when performing getContext(), like this:
const canvasContext = canvasElem.getContext("webgl2", {
alpha: false,
desynchronized: true
});
Changes the colors to be exactly as I set them.
That is, if I try to draw with the color #FF0000, it will draw exactly that. It makes sense to me why this would occur with setting alpha to false, because it prevents blending with the page's background (or whatever else is behind the canvas), but setting alpha alone doesn't seem to cause this effect.
Rather, you must have both in order for the canvas colors to not blend with the background of the page. I'm curious why this is.