Skip to content

Commit

Permalink
Make sure gradient is always a class when switching states or startin…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Treub committed Jun 28, 2017
1 parent ae0b628 commit 272bb60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framer/Animation.coffee
Expand Up @@ -331,7 +331,7 @@ class exports.Animation extends BaseClass
else if Color.isValidColorProperty(k, v)
animatableProperties[k] = new Color(v)
else if k is "gradient" and not _.isEmpty(Gradient._asPlainObject(v))
animatableProperties[k] = v
animatableProperties[k] = new Gradient(v)

return animatableProperties

Expand Down
3 changes: 3 additions & 0 deletions framer/Gradient.coffee
Expand Up @@ -4,6 +4,9 @@

class exports.Gradient extends BaseClass
constructor: (options = {}) ->

if options instanceof Gradient then return options

options.start ?= "black"
options.end ?= "white"
options.angle ?= 0
Expand Down

0 comments on commit 272bb60

Please sign in to comment.