Skip to main content
Participating Frequently
June 21, 2024
Question

Setting an expression colour in a light fill layer

  • June 21, 2024
  • 4 replies
  • 978 views

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 has been closed for replies.

4 replies

Legend
June 21, 2024
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.

Ben5FBEAuthor
Participating Frequently
June 23, 2024

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,

Inspiring
June 21, 2024

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.

Ben5FBEAuthor
Participating Frequently
June 21, 2024

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

Inspiring
June 21, 2024

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!

Roland Kahlenberg
Legend
June 21, 2024

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

hexToRgb("#7B8E31")


Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Inspiring
June 21, 2024

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

Ben5FBEAuthor
Participating Frequently
June 21, 2024

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.