Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need assistance with expression

  • Dan Ebberts

    January 19, 2011 at 6:33 pm

    Try this on the Fill effect’s Color parameter:

    colors = [
    [1,0,0,1], // red
    [0,1,0,1], // green
    [0,0,1,1], // blue
    [1,.5,0,1]]; // orange

    seedRandom(index,true);
    colors[Math.floor(random(colors.length))]

    Dan

  • Yair Katznelson

    January 19, 2011 at 7:43 pm

    10x very much!!
    can you explain what the numbers represent? / how do i represent specific colors i need with those numbers?

    I guess this is not RGB…

  • Dan Ebberts

    January 19, 2011 at 8:10 pm

    The numbers are rgba. It’s just that the values go from 0 to 1. So, 50% gray would be [.5,.5,.5,1], white would be [1,1,1,1], etc.

    You can set them up this way if it makes you more comfortable:

    [255,0,0,255]/255 (red)

    Dan

  • Yair Katznelson

    January 19, 2011 at 10:41 pm

    10x very much for your help!

  • Kevin Camp

    January 19, 2011 at 11:10 pm

    i’m sure yo’re done with this by now, but if you didn’t like figuring out the numerical values for rgba colors, you could add keyframes for the color change (and use the picker to set the colors), the use a slight modification of dan’s expression to randomize the keyframed value that the expression will choose…

    this way you wouldn’t need to build the array of rgb values.

    seedRandom(index, true);
    key(Math.floor(random(numKeys)+1)).value

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    January 20, 2011 at 12:16 am

    That’s a good idea. I like it.

    Dan

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