-
Target content fill without using e.g. “content(“Rectangle 1”).content(“Fill 1″).color”?
Hi,
I posted another question that is related to this subject today, but I felt like this question needed a seperate post. I’m working on a ‘script’ to add grain to objects. So far I’ve 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, the shadow color is linked to a checkbox. If you turn the checkbox on, you can pick your own color. If you turn the checkbox off, the color will be adjusted to the fill color of a Color Overlay effect. This works fine, but I’d rather NOT use a color overlay. I’d rather make the color adjust to the original fill color of the layer, so the fill color that belongs to its content.
Obviously, I could change the code to:
c = content("Rectangle 1").content("Fill 1").colorBut, that would mean that the shape has to be a rectangle. Is there another way to target the contents’ Fill color?