bibbyj Posted December 24, 2019 Share Posted December 24, 2019 Hi guys I'm trying to follow a tutorial, part of which uses the color Props Plugin, but it seems to have been removed from gasp 3. Has it been totally removed, or has its functionality been absorbed into another plugin, I can't seem to find any mention of it in the release docs, blog etc, Thanks in advance... Link to comment Share on other sites More sharing options...
Sahil Posted December 24, 2019 Share Posted December 24, 2019 See the Pen ExaXjmr?editors=0010 by Sahil89 (@Sahil89) on CodePen You no longer need colorProps plugin, gsap will detect color strings and animate them. From release notes Quote The core engine will find colors inside complex strings and animate them properly (no plugins necessary). And of course it'll find all the numbers inside complex strings and animate those as well. There is also new utility method called splitColor that you may find useful. 4 Link to comment Share on other sites More sharing options...
bibbyj Posted December 24, 2019 Author Share Posted December 24, 2019 8 minutes ago, Sahil said: You no longer need colorProps plugin, gsap will detect color strings and animate them. From release notes There is also new utility method called splitColor that you may find useful. Thanks for the quick reply, exactly what I needed to know, and yes I've been looking at splitColor, going to have a play with it shortly, so much to learn, and so many toys to play with! 2 Link to comment Share on other sites More sharing options...
bytrangle Posted September 18, 2021 Share Posted September 18, 2021 So I was learning from some demo for animating with Canvas and GSAP at this thread that happened to use the antiquated `colorPropsPlugin`. I'm delighted to learn that it's easy to migrate from this plugin with a few changes. Example for anyone interested: Old code: const tl = new TimelineMax({repeat: -1, yoyo: true}) tl.staggerTo( rects, 0.5, { colorProps: { fill: "#f1af11" } }, 0.1 ); rects here is just an array of different shapes I draw in Canvas. Each shape is an object with several properties, one of them is `fill`. New code: const tl = gsap.timeline({ repeat: -1, yoyo: true}) tl.to(rects, { duration: 0.5, fill: "f1af11", stagger: { each: 0.1 } }) Finished code 1 Link to comment Share on other sites More sharing options...
Cassie Posted September 18, 2021 Share Posted September 18, 2021 Thanks for dropping by to share this bytrangle! *Just a little note - the fill hex code in the second example will still need a # 1 Link to comment Share on other sites More sharing options...
bytrangle Posted September 18, 2021 Share Posted September 18, 2021 Oops, thank you for the catch, Cassie. I'm just sharing what I learn 😀. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now