diff options
author | wout <wout@impinc.co.uk> | 2014-01-31 19:01:16 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-01-31 19:01:16 +0100 |
commit | 859bbecc67cbb0d81cf8639c4cfefbf39151faef (patch) | |
tree | 3fd18fbcad4a7a480e1a2b14b7cabe5d4aa8c8ef /src/color.js | |
parent | a7288d90d3eb6529f635259d48084f407f81ca36 (diff) | |
download | svg.js-859bbecc67cbb0d81cf8639c4cfefbf39151faef.tar.gz svg.js-859bbecc67cbb0d81cf8639c4cfefbf39151faef.zip |
Fix in color morphing
Diffstat (limited to 'src/color.js')
-rwxr-xr-x | src/color.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/color.js b/src/color.js index 9821743..d870d5f 100755 --- a/src/color.js +++ b/src/color.js @@ -71,6 +71,9 @@ SVG.extend(SVG.Color, { /* make sure a destination is defined */ if (!this.destination) return this + /* normalise pos */ + pos = pos < 0 ? 0 : pos > 1 ? 1 : pos + /* generate morphed array */ return new SVG.Color({ r: ~~(this.r + (this.destination.r - this.r) * pos) |