diff --git a/lib/canvas.js b/lib/canvas.js index 9d39f35..44d9f4d 100644 --- a/lib/canvas.js +++ b/lib/canvas.js @@ -293,11 +293,7 @@ Context2d.prototype.__defineSetter__('strokeStyle', function(val){ * @api public */ -Context2d.prototype.__defineGetter__('strokeStyle', function(){ - var rgba = this.lastStrokeStyle; - return 'rgba(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ',' + rgba[3] + ')'; -}); - +Context2d.prototype.__defineGetter__('strokeStyle', normalizedColor('lastStrokeStyle')); /** * Set the shadow color with the given css color string. * @@ -325,7 +321,4 @@ Context2d.prototype.__defineSetter__('shadowColor', function(val){ * @api public */ -Context2d.prototype.__defineGetter__('shadowColor', function(){ - var rgba = this.lastShadowColor; - return 'rgba(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ',' + rgba[3] + ')'; -}); +Context2d.prototype.__defineGetter__('shadowColor', normalizedColor('lastShadowColor'));