Javascript forum,
I'm trying to use the alpha component of a color for a canvas.
function drawCanvas() {
ctx.fillStyle = 'rgba(0, 0, 255, 0.5)'
ctx.fillRect(0, 0, canvas.width, canvas.height);
requestAnimationFrame(drawCanvas);
}
The alpha is applied the first time through the function but then it
reverts back to the full color as if the alpha wasn't there?
What am I missing?
Any suggestions.
jerdonald
I'm trying to use the alpha component of a color for a canvas.
function drawCanvas() {
ctx.fillStyle = 'rgba(0, 0, 255, 0.5)'
ctx.fillRect(0, 0, canvas.width, canvas.height);
requestAnimationFrame(drawCanvas);
}
The alpha is applied the first time through the function but then it
reverts back to the full color as if the alpha wasn't there?
What am I missing?
Any suggestions.
jerdonald