Alright, so far I’ve managed to write the following expression:
if (effect("Lenny's Grain")("Shadow - Custom?") == 0 ? 100 : 0) {
c = effect("Lenny's Grain")("Fill");
hsl = rgbToHsl(c);
factor = effect("Lenny's Grain")("Shadow - Lightness") / 55;
newL = Math.min(hsl[2]*factor,1);
hslToRgb([hsl[0],hsl[1],newL,hsl[3]])
} else {
effect("Lenny's Grain")("Shadow - Color")
}
So, if I turn the checkbox on to add a custom shadow color, you can pick your own color. If I turn the checkbox off, the shadow uses a color that updates automatically to the fill color of a Color Overlay layer style. This works fine, but I’d rather not use a Color Overlay, I’d rather make the shadow color adjust to the content fill. This works fine if I just change the code to:
c = content(“Rectangle 1”).content(“Fill 1”).color
But that would mean that the shape has to be a rectangle. Is there another way to target the content fill?
