From 3c5e2ee4ea1a5e400af0468439e7865460976f26 Mon Sep 17 00:00:00 2001 From: Luis Leiva Date: Tue, 7 Nov 2017 08:43:20 +0100 Subject: [PATCH] Playing with radialCircle --- jsketch.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/jsketch.js b/jsketch.js index 4a221a1..cd7f555 100644 --- a/jsketch.js +++ b/jsketch.js @@ -309,13 +309,15 @@ this.graphics.closePath(); return this; }, - // experimental - radialCircle: function(x,y,radius,color,glowSize){ - var g = this.graphics.createRadialGradient(x,y,radius,x,y,glowSize); - g.addColorStop(0,color); - g.addColorStop(1.0,"rgba(0,0,0,0)"); - this.graphics.fillStyle = g; - this.fillCircle(x,y,radius); + /** + * Experimental. + * @ignore + */ + radialCircle: function(x,y,radius,glowSize,color1,color2) { + var g = this.graphics.createRadialGradient(x,y,radius,x,y, glowSize || 5); + g.addColorStop(0, color1 || this.graphics.fillStyle); + g.addColorStop(1, color2 || 'white'); + this.beginFill(g).fillCircle(x,y,radius).endFill(); return this; }, /**