I'm attempting a basic color transition using gsap to modify the renderer's background color.
The issue arises when trying to transition from white to black – it simply changes the color abruptly without any fade effect. Conversely, transitioning from black to white works flawlessly.
Here is the code snippet for transitioning from black to white:
gsap.to(renderer, {setClearColor: 'rgba(255,255,255,1)', duration: 2});
Now, here are the attempts at transitioning from white to black (tried various color inputs such as hex, rgb, rgba, with and without new THREE.Color):
gsap.fromTo(renderer, {setClearColor: new THREE.Color('#ffffff')}, {setClearColor:new THREE.Color('#000000'), duration: 2});
Additionally:
gsap.to(renderer, {setClearColor: 'rgba(0,0,0,1)', duration: 2});
It seems like the value is being cached as rgb(0,0,0), resulting in a transition from rgb(0,0,0) to rgb(0,0,0).