Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Expression to control Channel Range (in Hue/Saturation)?

  • Expression to control Channel Range (in Hue/Saturation)?

  • JeangJenq Loh

    June 20, 2016 at 11:36 pm

    I’m trying to make multiple layer’s fill color brightness change gradually by using index expression with some sort of lightness control. I’ve been trying to add expression on the fill color, by converting them to HSL and change the hsl[2] according to index, now I’m trying to use the master lightness value in Hue/Saturation to do that instead, but as Channel range controls Master Hue, Saturation and Lightness all together, I have no idea how to add expression on it that only controls Master Lightness. I thought it would be an array as it contains 3 values on it, but it’s not. Anyone know how this works?


  • Dan Ebberts

    June 21, 2016 at 6:44 am

    Unfortunately, that property has a property value type of CUSTOM_VALUE, so you won’t be able to access it with an expression.

    Dan

  • JeangJenq Loh

    June 21, 2016 at 9:18 pm

    Ah that explains it. I’ll fall back to using the rgbToHsl then,
    Thanks Dan!

  • Joe Clay

    June 22, 2016 at 3:15 pm

    You could also try this. Just set your output colors to vary in brightness only. I prefer this method over rgbToHsl if I can use it.

    https://workbench.tv/tutorials/2016-06-17_ColorCycle/

    Joe Clay
    Workbench.tv

  • JeangJenq Loh

    June 22, 2016 at 8:39 pm

    Thanks for the suggestion! However I’m trying to control my final output color using a fill effect on a null object? And I can’t put use expression on Colorama output cycle either.

  • Joe Clay

    June 22, 2016 at 9:19 pm

    So you’re trying to take that color from the fill and apply it to other layers? If that’s the case, unfortunately Colorama won’t output a color that you can apply to other layers.

    On any color parameter, you can add this kind of expression.

    hsla = rgbToHsl(value);
    hsla[2] = .3; //change this value, link it to a slider or whatever
    hslToRgb(hsla);

    Joe Clay
    Workbench.tv

  • JeangJenq Loh

    June 23, 2016 at 8:36 pm

    Thanks Joe! That works!

    Thanks Joe! That works great!

  • Joe Clay

    June 23, 2016 at 9:17 pm

    Awesome! You’re welcome!

    Joe Clay
    Workbench.tv

  • Ze’ev Gilad

    January 21, 2021 at 11:40 pm

    This is great, thanks! But why can’t I do something like:

    hsla = rgbToHsl(value);
    newColor = hsla * [1, .5, .5, 1];
    hslToRgb(newColor);

    This gives me error “one argument must be scalar.”

  • Dan Ebberts

    January 22, 2021 at 12:17 am

    You’re telling it to multiply two arrays. Try it this way:

    hsla = rgbToHsl(value);

    newColor = [hsla[0],hsla[1]*.5,hsla[2]*.5,hsla[3]];

    hslToRgb(newColor);

Viewing 1 - 10 of 10 posts

Log in to reply.

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