嘿,我有下面的代码,它给你一个“面具”的效果。
JSFiddle:http://jsfiddle.net/neuroflux/m5Fj2/7/
Basically, I would like a semi-opaque gradient instead of a circle... I tried to put the following code in, but to no advail.
grad = ctx.createRadialGradient(0,0,0,0,0,600);
grad.addColorStop(0, #000 );
grad.addColorStop(1, rgb( + color + , + color + , + color + ) );
// assign gradients to fill
ctx.fillStyle = grad;
// draw 600x600 fill
ctx.fillRect(0,0,600,600);
但我无法让它发挥作用:(
救命。