I’ve seen lots of questions asking how to draw a semi-transparent rectangle or other shape onto canvas after it’s already been drawn to. My problem is that I want a rectangular area to be 0 alpha, but it seems to draw just nothing on top of what is there. I understand why that is (you are drawing 0 alpha on top of something that is already drawn), but I want those pixels 0 alpha. There has to be way.
Basically, I want to define an area that has 0 alpha after the canvas has already something drawn to it.
function fillPreviewClearColor(x,y)
{
ctx2.beginPath();
ctx2.rect(x, y, 10, 10);
ctx2.fillStyle = "rgba(255, 255, 255, 0.0)"; // I want NOTHING here
ctx2.fill();
ctx2.restore();
}