Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random colour fill from a range of preselected colours

  • Walter Soyka

    December 7, 2020 at 9:53 pm

    Assuming you have a Fill in each group in the shape layer, I’d add an expression to each Fill so they each display a random brightness value from black [0,0,0] to white [1,1,1]. Then I’d use a Colorama effect on the layer (with Interpolate Palette set to Off!) to force the windows to your specific palette.

    You can use an expression like this:

    // use seedRandom to generate a "timeless" value
    seedRandom(1, true);
    // pick a random number between 0 and 1
    var x = random();
    // put that same random number into the red, blue and green channels
    // to give us a brightness value. Keep alpha full!
    [x,x,x,1]

    I’ve attached a sample project that shows how it all works together. Please ask questions if anything isn’t clear!

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