I'm trying to do a simple color transition with gsap, modifying the renderer color(background)
The thing is, the transition from black to white works perfectly, but when i try the one from white to black, it just change the color without any transition, just switches from white to black without any fade.
Here is the code from black to white:
gsap.to(renderer,{setClearColor:'rgba(255,255,255,1)', duration: 2});
And here is the one from white to black ( I tried both these possibilities, with all possible color inputs(hex, rgb, rgba, etc.) with and without new THREE.Color ):
gsap.fromTo(renderer,{setClearColor: new THREE.Color( '#ffffff' )},{setClearColor:new THREE.Color( '#000000' ), duration: 2});
And this:
gsap.to(renderer,{setClearColor:'rgba(0,0,0,1)', duration: 2});
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment