diff options
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/element.js b/src/element.js index 63f8c31..e11f650 100644 --- a/src/element.js +++ b/src/element.js @@ -160,6 +160,10 @@ SVG.extend(SVG.Element, { if (a == 'stroke-width') this.attr('stroke', parseFloat(v) > 0 ? this.attrs.stroke : null) + /* ensure hex color */ + if (SVG.Color.test(v) || SVG.Color.isRgb(v) || SVG.Color.isHsb(v)) + v = new SVG.Color(v).toHex() + /* set give attribute on node */ n != null ? this.node.setAttributeNS(n, a, v) : |