greensock / GSAP

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
https://gsap.com
19.83k stars 1.72k forks source link

set fill: 'url()' is changed to fill: rgb() #256

Closed fregante closed 6 years ago

fregante commented 6 years ago

I think GSAP is assuming fill is always a color and is trying to parse it, while attr doesn't parse it and thus works correctly

https://codepen.io/bfred-it/pen/RMjLKv

jackdoyle commented 6 years ago

Ah yes, this seems like a rather extreme edge case. Thanks for pointing it out though. Keep in mind that:

So again, in this case I'd recommend simply setting the value directly. For the 2.x release, I'll look for ways to better accommodate simple set() calls like this. Like perhaps a quickSet() that is NOT a tween instance and is solely meant to immediately change values without recording anything or concerning itself with interpolation. Fair enough?

fregante commented 6 years ago

That probably sounds good. The problem with raw DOM API calls is that they’re not as easy to add in a reversable timeline

jackdoyle commented 6 years ago

True, though you could just add a call() in the timeline that'll do it, and maybe another that's SUPER close to it, like 0.00001 seconds before it that sets it to the initial value. There are other ways to do this too - let me know if you need any help. I know you're an advanced user, so you're probably already aware of several options.

fregante commented 6 years ago

I’ll stick to attr for now, I don’t want to set multiple function calls to set/unset it when GSAP can take care of it via AttrPlugin 🙂