-
Expression to control Brightness (HSB) over Luminance (HSL)
I know how to use luminance to drive an expression, but I’m having issues with those values. It’s my understanding that Luminance is an average of all color values (RGB). Where Brightness is a control of how much white vs black is added when using HSB values. Since you can create color using HSB in AE I need to reference the “B” value of a layers color.
I have this on Opacity of the layer I am trying to control.
c = thisComp.layer(“Color”).content(“Group 1”).content(“Fill 1”).color;
L = rgbToHsl(c)[2];
(L < .6) ? [50] : [0]This works partially, but saturated colors cause the opacity to be set to 50%. I would like the expression to trigger if brightness is above 60%. I have tried adding in Saturation as value too, but that doesn’t work either. Ideally I would like the expression triggered based off the Brightness of the color and not the Luminance. Is there anyway at all to do this? Thank you.