Page 1 of 1

random pick color

Posted: February 12th, 2007, 2:55 pm
by kunyi
It might be simple, but how can I make an expression to random pick the color in the color attribute,? I've try put the rgb color number but it didnt work.any way to identify the color?
thank so much
Kuni

Posted: February 12th, 2007, 4:46 pm
by pdeb
kunyi,

This gives you a random colour that doesn't change over the duration of the comp (I usually apply this to the Tint effect):

seedRandom(index, true);
R=random(0, 1);
G=random(0, 1);
B=random(0,1);
[R,G,B,1] //where 1 is alpha, I believe

You can also attach expression sliders for min and max R, G, and B and substitute these for (0,1) if you want to animate the colour or bias the random colours towards a particular hue.

HTH,
pdeb

thanks

Posted: February 12th, 2007, 7:42 pm
by kunyi
Thanks a lot, it's simple than I thought!