ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to change color of characters.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Justin Cubbage
Expression to change color of characters.
on May 22, 2019 at 3:42:54 pm

A client wanted a video inspired by this video;






I have built an expression to create the changing of the text, they are insistent on having 1 character being different on each slide. I obviously am trying to avoid building each slide, I tried using the expression below to even just change certain characters, but I am getting an error at the switch(txt[textIndex-1]) line.

Any ideas?

txt = text.sourceText;
switch(txt[textIndex-1]){
case "A":
color = [0,1,0];
break;
case "C":
color = [0,0,1];
break;
case "T":
color = [1,1,0];
break;
case "G":
color = [1,0,0];
break;
default:
color = [0,0,0];
break;
}
color*100


Return to posts index

Dan Ebberts
Re: Expression to change color of characters.
on May 22, 2019 at 4:32:55 pm

I think you're going to need a separate Fill animator for each color with an expression selector and an expression like this (this on is to make any "A" characters red):

txt = text.sourceText.value;
(txt[textIndex-1] == "A") ? 100 : 0


Dan



Return to posts index

Justin Cubbage
Re: Expression to change color of characters.
on May 22, 2019 at 6:40:47 pm

Thank you!


Return to posts index

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