Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Setting an expression colour in a light fill layer

New Here ,
Jun 20, 2024 Jun 20, 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!

 

TOPICS
Expressions
840
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 20, 2024 Jun 20, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 20, 2024 Jun 20, 2024

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2024 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2024 Jun 21, 2024

thanks- unfortunately still getting error. tried comp("Main").layer("ColorControl").effect("Light")("Color")hexToRgb("#7B8E31")  any thoughts?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 20, 2024 Jun 20, 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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 20, 2024 Jun 20, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2024 Jun 21, 2024

thanks- tried this but unfortunately still getting an error- see attachederror2.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 21, 2024 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 23, 2024 Jun 23, 2024
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines