Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random for text Color

  • Random for text Color

    Posted by Daniel Goldman on July 3, 2009 at 1:18 pm

    I was trying to add a random expression to fill RGB for a text. I tried random([0],[1],[2],[3])thinking it would work but I got an error. What did I do wrong. Random () goes between 0 and 1 which is what I need.Do I need to set up variables first?
    Thank you

    Darren Hardaway replied 16 years, 10 months ago 4 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    July 3, 2009 at 1:55 pm

    This should do it:

    random([1,1,1,1])

    If you want it to hold the random color rather than change every frame you’d do this:

    seedRandom(index,true);
    random([1,1,1,1])

    Dan

  • Jean Pier biasiolo merchan

    July 3, 2009 at 10:12 pm

    Dan Ebberts I have used your code and have not had a result of random colors that I had to integrate the code

    ” seedRandom(index,true);
    random([1,1,1,1]) ” color purple

    achievement but not change color random mind as time passes

    You can combine this tag with an expression of time?

    un saludo desde España Sevilla
    greetings from Seville Spain

  • Dan Ebberts

    July 3, 2009 at 10:23 pm

    Hmmmm…. I’d need a better description of how you want the colors to vary with time.

    Dan

  • Jean Pier biasiolo merchan

    July 3, 2009 at 10:37 pm

    Try to explain better my language is not English: P
    and will write me very badly but I will try to do good 😛
    Example: let’s say I create a text with a soft color, but I want to change his mind without stopping random color. I work for what could be done? and give thanks for advance;)

    Adobe After Effects Animator

  • Dan Ebberts

    July 3, 2009 at 10:42 pm

    I think we may need someone that knows both Spanish and English to jump in here.

    Dan

  • Darren Hardaway

    July 6, 2009 at 5:41 am

    I think hes looking for this dan, your random motion script rewritten for it to work on color:

    segDur = .5;// duration of each “segment” of random motion
    minVal = [0,0,0,1];
    maxVal = [1,1,1,1];

    seed = Math.floor(time/segDur);
    segStart = seed*segDur;
    seedRandom(seed,true);
    startVal = random(minVal,maxVal);
    seedRandom(seed+1,true);
    endVal = random(minVal,maxVal);
    ease(time,segStart,segStart + segDur, startVal, endVal);

    BTW full kudos to Dan for writing the expression, I just changed two lines so it would affect color. Is this what you were looking for?

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