-
Changing colors along the Hue wheel instead of blending.
Hi all!
I’m working on a “Dynamic Color” animation where I’m changing the colors of different elements according to a set of colors. The problem is that when changing from one color to another in AE it just fades between the colors, often making the in-between colors rather washed out.
So what I want to try is animating the colors from one to the next along the Hue wheel. So I set up keyframes with the HSL values on a Color Balance effect. Then I thought it would be an easy thing to get the resulting colors back into the Color (Expression Control) effect. (The project is set up so the different elements pick their colors from a set of different Color effects, that’s why I want the resulting back into that Color effect.) So I set it up like this thinking it would be straight forward getting the resulting color back through the hslToRgb function:
var hue = effect(“Color Balance (HLS)”)(“Hue”)/360;
var sat = effect(“Color Balance (HLS)”)(“Saturation”)/100;
var lightness = effect(“Color Balance (HLS)”)(“Lightness”)/100;
var alpha = 1;
hslToRgb([hue, sat, lightness, alpha]);
But by dividing Lightness by 100, making it 1 (because lightness is constantly 100) just generates a completely white result. I tried multiplying it with different values (0.5 – 0.99) getting it darker, but I can’t find the value to perfectly match the brightness. Also, the Saturation doesn’t seem completely correct all the time either.
Is there a formula or value that I need to put in to Lightness and possibly Saturation to get it to generate the colors I have set the values for in Color Balance?
Or if there is possibly a different way of reaching the effect I’m after?
Thank you!
/ Dan