ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change layer color using text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Asaf Lazarovich
Change layer color using text
on Apr 26, 2018 at 2:58:53 pm

Hi, so I need to change a layer's color using the fill effect, but I need to get the color data as a text from a spreadsheet.
I have Layer1 which is a text layer
and Layer2 which I want it's source text (for example: 1E29FF) to be used by Layer1's fill effect to determine Layer1's color
is that possible?
thank you!


Return to posts index

Dan Ebberts
Re: Change layer color using text
on Apr 26, 2018 at 4:46:16 pm

If Layer2 has the text for a hex number, I think something like this would work:

txt = thisComp.layer("Layer2").text.sourceText;
hex = parseInt(txt,16);
r = hex >> 16;
g = (hex & 0x00ff00) >> 8;
b = hex & 0xff;
[r/255,g/255,b/255,1]


Dan



Return to posts index

Asaf Lazarovich
Re: Change layer color using text
on Apr 26, 2018 at 6:42:07 pm

works perfectly, thanks so much Dan


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]