Skip to main content
Participating Frequently
Jun 21, 2024 3:28 AM UTC
Question

Setting an expression colour in a light fill layer

Hi, I'm having trouble changing the colour of a light layer in a logo reveal template.

When I change the  colour from red to green it keeps defaulting to red.

I think it is to do with the expression which is comp("Main").layer("ColorControl").effect("Light")("Color").

I've tried various commands such as comp("Main").layer("ColorControl").effect("Light")("Color")("fillColor#7B8E31")  and "ColorControl#7B8E31")  but keep getting error warnings.

Could someone help? Thanks very much!

 

This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

Legend
Jun 21, 2024 11:14 AM UTC
comp("Main").layer("ColorControl").effect("Light")("Color")

should be enough, try to check the name of the composition, the layer name and the effect name in the expression, there might be an issue with capital letters.

Translate
Ben5FBEAuthor
Participating Frequently
Jun 23, 2024 7:45 AM UTC

thanks very mcuh - tried this but since been told that apparently it had to be altred on another layer and not in the same expression,

Translate
Inspiring
Jun 21, 2024 6:15 AM UTC

Ensure you are using the correct syntax by setting the color property directly, like this: `comp("Main").layer("ColorControl").effect("Light")("Color").setValue([0.482, 0.557, 0.192])` for a green color.

Translate
Ben5FBEAuthor
Participating Frequently
Jun 21, 2024 9:10 AM UTC

thanks- tried this but unfortunately still getting an error- see attached

Translate
Inspiring
Jun 21, 2024 6:10 AM UTC

Hi, I'm having trouble changing the colour of a light layer in a logo reveal template.

When I change the  colour from red to green it keeps defaulting to red.

I think it is to do with the expression which is comp("Main").layer("ColorControl").effect("Light")("Color").

I've tried various commands such as comp("Main").layer("ColorControl").effect("Light")("Color")("fillColor#7B8E31")  and "ColorControl#7B8E31")  but keep getting error warnings.

Could someone help? Thanks very much!

Translate
Roland Kahlenberg
Legend
Jun 21, 2024 4:46 AM UTC

Since you've got the Hex Code, use the hexToRGB Expression Function - 

hexToRgb("#7B8E31")


Translate
Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Inspiring
Jun 21, 2024 6:17 AM UTC

Use the `hexToRgb` function like this: `comp("Main").layer("ColorControl").effect("Light")("Color").setValue(hexToRgb("#7B8E31"))`.

Translate
Ben5FBEAuthor
Participating Frequently
Jun 21, 2024 9:01 AM UTC

Tried this but still getting an error unfortunately.

full script looked liked this: comp("Main").layer("ColorControl").effect("Light")("Color").setValue(hexToRgb("#7B8E31")

also tried with the 2 brackets.

Translate