Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing colors along the Hue wheel instead of blending.

  • Changing colors along the Hue wheel instead of blending.

    Posted by Dan Lind on April 29, 2025 at 1:50 pm

    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

    Dan Ebberts replied 1 week, 6 days ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 29, 2025 at 6:21 pm

    Try it this way:

    h = effect("Color Balance (HLS)")("Hue")/360;
    l = (effect("Color Balance (HLS)")("Lightness") + 100)/200;
    s = (effect("Color Balance (HLS)")("Saturation") + 100)/200;
    hslToRgb([h,s,l,1])
  • Dan Lind

    April 30, 2025 at 7:34 am

    Thank you for your reply. Unfortunately the result was the same, completely white.

    I tried finding the right multiplier but when one color becomes (close to) correct in brightness, the next color is way off. Saturation is also affected but not as much.

    I was thinking if this could be a gamma issue, but don’t really know how to add gamma into the mix to test.

  • Dan Ebberts

    April 30, 2025 at 9:17 am

    I’m probably missing something, but I get fully saturated colors if I have the Color Balance (HLS)’s Lightness set to 0 and the Saturation set to 100. I only get white if I move Lightness to 100.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy