• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Setting an expression colour in a light fill layer

New Here ,
Jun 20, 2024 Jun 20, 2024

Copy link to clipboard

Copied

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

Views

348

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

hexToRgb("#7B8E31")


Very Advanced After Effects Training | Adaptive & Responsive Motion Graphics

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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,

Votes

Translate

Translate

Report

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