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 pmI’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 amUnfortunately, 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 pmAh that explains it. I’ll fall back to using the rgbToHsl then,
Thanks Dan!Joe Clay
June 22, 2016 at 3:15 pmYou 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.tvJeangJenq Loh
June 22, 2016 at 8:39 pmThanks 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 pmSo 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.tvJeangJenq Loh
June 23, 2016 at 8:36 pmThanks Joe! That works!
Thanks Joe! That works great!
Joe Clay
June 23, 2016 at 9:17 pmAwesome! You’re welcome!
Joe Clay
Workbench.tvZe’ev Gilad
January 21, 2021 at 11:40 pmThis 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 amYou’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);
Log in to reply.