ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change color of the shape by text value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gustavo Duque Estrada
Change color of the shape by text value
on Apr 29, 2020 at 9:35:24 pm

Hello guys

I´m have little knowledge in the expressions like wiggle, sourceReactatime. But now i´m trying to change the color of one shape or object by a text value like this

When the text is 50% the color of shape is green, otherwise the color of shape is red.

someone can help me? THANKS

i dont have the expressions yet


Return to posts index

Dan Ebberts
Re: Change color of the shape by text value
on Apr 29, 2020 at 9:47:49 pm

I think this does what you're asking for. I'm not sure it's what you meant though.

txt = thisComp.layer("Text").text.sourceText;
txt == "50%" ? [0,1,0,1] : [1,0,0,1]


Dan



Return to posts index

Gustavo Duque Estrada
Re: Change color of the shape by text value
on Apr 29, 2020 at 10:25:47 pm

I would like to have color green when the text shows 50% or more and be red when the texts shows 49% or less

like some statistics from excell when you have debts your money goes red.

you know?


Return to posts index


Dan Ebberts
Re: Change color of the shape by text value
on Apr 29, 2020 at 10:57:45 pm

This should be closer:

txt = thisComp.layer("Text").text.sourceText;
parseFloat(txt) < 50 ? [0,1,0,1] : [1,0,0,1]


Dan



Return to posts index

Gustavo Duque Estrada
Re: Change color of the shape by text value
on Apr 29, 2020 at 11:09:37 pm

UAU!!!

THAT WORKS PERFECT! YOU ARE A GENIUS!


Return to posts index

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