Transparent Arc on HTML5 Canvas

Posted by Rigil on Stack Overflow See other posts from Stack Overflow or by Rigil
Published on 2011-01-15T23:59:12Z Indexed on 2011/01/16 2:53 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

Here I have an arc with some transparency applied to one of the two gradients its using:`

ctx.arc(mouseX,mouseY,radius,0, 2*Math.PI,false);
var grd=ctx.createRadialGradient(mouseX,mouseY,0,mouseX,mouseY,brushSize); 
grd.addColorStop(1,"transparent");
grd.addColorStop(0.1,"#1f0000");
ctx.fillStyle=grd;
ctx.fill();

Is there a way to now give the entire arc some transparency affecting only the arc and none of the rest of the canvas?

Thanks

© Stack Overflow or respective owner

Related posts about html5

Related posts about canvas