{"author_name":"meat_popsicle","cat":"LD #26","comments":[],"epoch":1367073840,"likes":1,"metadata":{"p_key":"45088","p_author":"meat_popsicle","p_authorkey":"21777","p_urlkey":"80746","p_title":"CraftyJS \u2013 TweenColor","p_cat":"LD #26","p_event":"LD26","p_time":"1367073840","p_likes":"1","p_comments":"1","p_status":"UPD5","us_key":"21777","us_name":"meat_popsicle","us_username":"meat_popsicle","event_start":"1366934400","event_key":"16","event_name":"LD26"},"text":"<p>So when using <a href=\"http:\/\/craftyjs.com\/\">CraftyJS&#8217;s<\/a> tweens, it doesn&#8217;t tween colors.<\/p>\n <p><a href=\"http:\/\/craftyjs.com\/api\/Tween.html\">Tween::tween<\/a> only works on numeric attributes.<\/p>\n <p>color is stored as a string<\/p>\n <p>So I&#8217;ve spent the past 3 hours figuring that out and how to fix colors.<\/p>\n <p>Find my <a href=\"https:\/\/github.com\/bisrael\/LD26\/tree\/master\/scripts\/components\">TweenColor<\/a> component on <a href=\"https:\/\/github.com\/bisrael\/LD26\/tree\/master\/scripts\/components\">github<\/a>.<\/p>\n <p>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}).<\/p>\n <p>.tweenColor is .tweenColor({r:r,g:g,b:b}, frames)<\/p>\n <p>Maybe this helps someone. <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/simple-smile.png\" alt=\":)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/color\/\" rel=\"tag\">color<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/crafty\/\" rel=\"tag\">Crafty<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/craftyjs\/\" rel=\"tag\">craftyjs<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/tween\/\" rel=\"tag\">Tween<\/a><\/p>","time":"April 27th, 2013 9:44 am","title":"CraftyJS \u2013 TweenColor"}