aboutsummaryrefslogtreecommitdiffstats
path: root/src/animation/Morphable.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation/Morphable.js')
-rw-r--r--src/animation/Morphable.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/animation/Morphable.js b/src/animation/Morphable.js
index 4d52066..56ffe95 100644
--- a/src/animation/Morphable.js
+++ b/src/animation/Morphable.js
@@ -80,10 +80,17 @@ export default class Morphable {
}
}
- var result = (new this._type(value)).toArray()
+ var result = (new this._type(value))
+ if (this._type === Color) {
+ result = this._to ? result[this._to[4]]()
+ : this._from ? result[this._from[4]]()
+ : result
+ }
+ result = result.toArray()
+
this._morphObj = this._morphObj || new this._type()
- this._context = this._context ||
- Array.apply(null, Array(result.length)).map(Object)
+ this._context = this._context
+ || Array.apply(null, Array(result.length)).map(Object)
return result
}
@@ -129,7 +136,7 @@ export class NonMorphable {
}
toArray () {
- return [this.value]
+ return [ this.value ]
}
}