Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change color of a single character using expressions.

  • Change color of a single character using expressions.

    Posted by Carlos Pendas on November 13, 2015 at 5:16 am

    Im using this expression to create a blinking cursor animation:

    I want the “|” character to be a different color, the fact that it’s blinking makes it a little more difficult as it is not always the last character in the string. Some way to change it’s color? Using expressions or any other method.

    Thanks!

    L = text.sourceText.length;
    PT = time - thisLayer.inPoint;
    T = PT*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");
    F = Math.round(PT % 1);

    if(F == 1 | (T0) ){Fl = "|";}else{Fl ="";}

    substr(0,T) + Fl

    Xavier Gomez replied 10 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Xavier Gomez

    November 13, 2015 at 1:28 pm

    You’d need a text animator (Fill Color).
    But then it’s easier if you animate the blink the same way, using a text animator (Opacity).
    Here is a setup that works, it migh be what you want:

    The screen was not bigh enough to show everything, so, in words :
    The second animator is a duplicate of the first, with

    (1) the Opacity property replaced by Fill Color,
    (2) the Amount expression removed.

    (all other settings and expressions are the same as for the first animator).

    Hope that works.

    Xavier.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy