I have an three.js object which is a given colour. I want to animate it smoothly to another colour. During the animation, it should only show a direct gradation between the start and end. That is, it should not perform the tween linearly in RGB colour space. I’m not even sure that a linear tween within HSV space would look good either.
How can I get this kind of colour tween on a three.js object?
I have a version of this that makes a tween in HSV space. It’s not perfect, as many different hues can appear along the way.
Three.js doesn’t include a method for getting the HSV values from a
THREE.Color. So, add one:Then, the tween is relatively straightforward:
I’d be interested to hear of a more perceptually natural transition.