ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Text Color Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aviram Avidan
Text Color Expression
on Feb 18, 2014 at 6:48:05 pm

Hello, Is there a way to type a text and tell it that I want every second letter in a specific color?

example.. lets say I'm typing the word "SCHOOL". and I want the S to be in color #1, C to be in color #2, H again in color #1..etc.


I need like a preset because I work for a TV channel that has a specific graphic kit that involves this sort of design with different titles every time and It's very frustrating to go letter by letter and change the color...a preset could really save me a lot of time.

thank you.


Return to posts index

Dan Ebberts
Re: Text Color Expression
on Feb 18, 2014 at 10:52:07 pm

This would be one way to do it. Set your text up in color 1. Add a fill color Animator and set it to color 2. Add and expression selector and set its Amount expression to this:

textIndex%2 ? 0 : 100

That should set letters 2,4,6... to color 2. I'm guessing you could save that as a preset, but I haven't tried it.

Dan



Return to posts index

Aviram Avidan
Re: Text Color Expression
on Feb 19, 2014 at 10:11:06 pm

that's brilliant!! it works!!

only one problem though....how can i tell the expression to ignore spaces? now when i type a new word in the text layer it treats the space as a character and the result is 2 letters in the same color..the last letter of the first word, and the first letter in the second word...


Return to posts index


Dan Ebberts
Re: Text Color Expression
on Feb 19, 2014 at 10:39:38 pm

In the expression selector, set Based On to Characters Excluding Spaces.

Dan



Return to posts index

Aviram Avidan
Re: Text Color Expression
on Feb 21, 2014 at 1:08:05 pm

You have no idea how much time you saved me. it's work perfect now. thank you!!


Return to posts index

Christoph Heil
Re: Text Color Expression
on Dec 13, 2016 at 9:34:33 am

Hi Dan!

I Have a similar question: i need to set the last character from my text-layer to a different color. unfortunately this is a letter that comes from the expression below

can you tell me how to set this "|" to a different color than the rest of the text?

Thanks in advance!
boomziboi


L = text.sourceText.length;
T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");
F = Math.round(time % 1);
if(F == 1 | (T0) ){Fl = "|";}else{Fl=" ";}
substr(0,T) + Fl


Return to posts index

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