-
calculate complimentary colors from shape layer
hi all,
I have a comp with multiple lights and I’d like to be able to control the hues of the lights parametrically.
I can create a shape layer and a light, and use an expression to make the light color the same as the color of the shape layer.What I’d like to do:
Make a spot light and an ambient light, and have the hues of these 2 lights always be opposite colors (180 degrees away in the HSL wheel), or something like that. eg, if the spot light is red, ambient light is cyan. As spot light moves toward yellow, ambient light moves toward blue.
This involves coercing the RGBA color of the shape layer to HSL, changing just the H value, then coercing back to RGBA.
I tried this but get error in line 1, “array piece can’t expand to more than one value”Anyone have syntax for making this work? thanks!!
masterCol = (thisComp.layer("Shape Layer 1").content("Fill 1").color) ;
hslCol = rgbToHsl(masterCol) ;
hue = hslCol [1] ;
sat = hslCol [2] ;
lum = hslCol [3] ;
newHue = hue + 180 ;
newCol = [newHue,sat,lum] ;
[hslToRgb(newCol)] ;