D
D
Dmitry2017-10-10 06:03:14
Canvas
Dmitry, 2017-10-10 06:03:14

How to make canvas - shadow on a translucent shape?

I have a translucent form:

this.cx.beginPath();
this.cx.globalAlpha = .1;
this.cx.fillStyle = gradientFill;
this.cx.strokeStyle = gradientStroke;
this.cx.arc(150, 150, 139, 0, Math.PI * 2, true);
this.cx.lineWidth = 1;
this.cx.stroke();
this.cx.fill();

I want to add some shadow, but I only want it to appear outside of the form, I think more of a glow than a shadow. Is there a way to do this in canvas as my attempts are:
this.cx.shadowColor = 'rgba(0, 0, 0, .75)';
this.cx.shadowBlur = 5;
this.cx.shadowOffsetX = 5;
this.cx.shadowOffsetY = -5;

A dark shadow is visible through the translucent form.
Thanks to!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question