Posts Tagged ‘Tween’

CraftyJS – TweenColor

Posted by
Saturday, April 27th, 2013 9:44 am

So when using CraftyJS’s tweens, it doesn’t tween colors.

Tween::tween only works on numeric attributes.

color is stored as a string

So I’ve spent the past 3 hours figuring that out and how to fix colors.

Find my TweenColor component on github.

Small caveat: you must set colors completely through the new ::rgb method, you can call .rgb(r,g,b) or .rgb({r:r, g:g, b:b}).

.tweenColor is .tweenColor({r:r,g:g,b:b}, frames)

Maybe this helps someone. :)

[cache: storing page]