Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to randomly change color of characters

  • Dan Ebberts

    March 30, 2018 at 7:51 pm

    Try it this way:

    x=effect(“Color Control”)(“Color”);
    y=effect(“Color Control 2”)(“Color”);
    palette = [[x[0],x[1],x[2]]*100, [y[0],y[1],y[2]]*100];
    idx = (textIndex-1)%palette.length;
    palette[idx]

    Dan

  • Marissa Joyner

    March 30, 2018 at 8:59 pm

    gosh darnit I knew it was something small, lol!

    Thank you Dan!!!!!

    After Effects template maniac
    https://www.fluxvfx.com/

  • Lewis Lloyd

    May 12, 2019 at 10:38 pm

    Hi Dan,

    I read through your informative answers on this thread, and I managed to get the first script you posted working – but the following ones didn’t work for me unfortunately. I actually just want individual characters in my text to switch between black and white – like in the file attached. Is there an easy way to do this with a script? I sadly couldn’t get the one with a colour palette to work. Any help much appreciated.

    Thanks!

    Lewis

    13336_titlestest.mp4.zip

  • Dan Ebberts

    May 12, 2019 at 11:38 pm

    >I sadly couldn’t get the one with a colour palette to work.

    This works for me (black text, white fill animator):

    dur = .25; // length of time to hold each color
    seedRandom(textIndex,true);
    seg = Math.floor((time+random(999))/dur);
    seedRandom(seg,true);
    palette = [[100,100,100],[0,0,0]];
    // [white,black]
    idx = Math.floor(random(palette.length));
    palette[idx]

    Dan

  • Lewis Lloyd

    May 13, 2019 at 1:59 pm

    Thank you so much @Dan Ebberts, you are a true original legend!

  • Karin Jager

    June 11, 2019 at 2:04 pm

    Hi,

    As other users before, I’m stuck with an expression that I can not write properly.
    I’m using AE CS6.
    I need to randomly animate the colors of individal characters in words, from white to colors.

    I need characters to color gradually from left to right, one after the other. For that, I animated the end property with two keys, from 0% to 21% (because there is 21 characters, spaces included).

    Text is white, fill color is black. I copy the code I found on Dan’s former posts, it creates random colors from the first key at 2 sec, but not gradually. Here is my screenshot, sorry that this is in French, I hope you ‘ll understand my request, I am not a specialist. I’ve been trying a lot of things that does not work !
    Thanks in advance for your help, I’m getting mad with it ????
    Karin

  • Kalleheikki Kannisto

    June 12, 2019 at 6:14 am

    Which expression are you using? There are six variations in this thread.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Karin Jager

    June 12, 2019 at 11:47 am

    Hi,

    Thanks for answering.
    I’m using Animate/Fill Color/RGB and add selector expression in it, where expression is.
    It’s maybe clearer in English :

    K

  • Kalleheikki Kannisto

    June 13, 2019 at 7:35 am

    Ok, I see. Easiest to add a second animator and use it to overlay white on top of the animated color.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Karin Jager

    June 13, 2019 at 4:08 pm

    Many many thanks Kalleheikki Kannisto, It seems so easy when you know how to do it ???? Is there any chance that I could get your file 13421_colorletters.aep in a downgrade version ? (I use CS6) I would really like to see it.
    Thanks again !

Page 4 of 5

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