Skip to main content
New Participant
June 18, 2009
Answered

Apply Random Color to Group of Objects

  • June 18, 2009
  • 5 replies
  • 73182 views

Hello all, thanks for taking the time to help.

Here's my issue... lets say I have 600 different objects in illustrator (just little circles with a fill color, no stroke) and 6 different colors that these circles should be. That means, I'd like about a 100 to be one color, 100 another color, etc... Is there anyway to select all 600 and just tell Illustrator that I have these 6 colors and I want to apply them to the selected objects randomly?

Let me know if this is confusing... hopefully there is some option to do this. I don't want to apply them manually...

Thanks!

    This topic has been closed for replies.
    Correct answer Harron_K_Appleman

    Rats. The [none] (no-color) swatch is stubborn.

    I was able to remove the [registration] swatch from the mix by making sure it's at the head of the palette and adding a (If swatchIndex>1) test to the script. But I can't get rid of the [none] swatch no matter what I do. Illustrator must treat it as a special case so that it cannot be referred to by index number.

    Help, James!

    One other thing: Not for nothing, but...

    lets say I have 600 different objects in illustrator (just little circles with a fill color, no stroke) and 6 different colors that these circles should be. That means, I'd like about a 100 to be one color, 100 another color, etc.

    ...is not exactly the same thing as...

    select all 600 and just tell Illustrator that I have these 6 colors and I want to apply them to the selected objects randomly

    What you want is a uniform distribution of those six colors but in no discernible pattern. That's not true random assignment, and this script won't get you there even if got the unwanted swatches out of the mix.

    No obvious solution here.


    OK. Got it. Had to modify the script a bit more.

    RandomSwatchFill.gif

    As I wrote in the previous post, this is done with a random number generator, and that's not exactly what you want. But if you want to play with the script, here is the modified version:

    http://harron.home.acedsl.com/Misc/HKA_RandomSwatchFIll.zip

    Make sure you make the undeletable swatches -- [none] and [registration] -- the first two in the palette/panel.

    5 replies

    Jacob Bugge
    Community Expert
    November 10, 2019

    blasta,

     

    I would suggest your trying over here,

     

    https://community.adobe.com/t5/Photoshop/bd-p/photoshop

    Ray Yorkshire
    Participating Frequently
    July 20, 2015

    Good old thread .

    I'm using windows 7 and illustrator 2015.0.1

    From the suggestions here, I've managed to get two random colour fill scripts to work.

    First the one posted

    If I've messed up posting  the link, please Google:

    Vector boom Free Illustrator Script - Random Swatches Fill

     

    skilled_thinking15A8
    Adobe Employee
    Adobe Employee
    September 17, 2015

    An other script do the same, but based on a selected Swatches Group:

    CSscripts/illustrator/randomizeColors at master · davidderaedt/CSscripts · GitHub

    Hope that can help!

    blasta20445892
    Known Participant
    November 10, 2019

    Hi, i know its old thread, but is there similiar script like this but for photoshop?

    New Participant
    June 23, 2015

    Hello people. I've been using HKA_randomSwathFill with Illustrator CC 2014 and loving it. It's amazingly useful for the work that I do. But with the CC 2105 update it no longer works. Has anyone seen an updated version of this script that will work with CC 2015? I need to find one right away. Thank you, thank you!

    Shape Design
    New Participant
    July 20, 2015

    I agree! This is really useful somewhere. It should be built into illustrator.

    November 24, 2011

    Can you please put the script back on the link?

    Inspiring
    November 25, 2011

    OK. It's back. URL remains the same.

    Jacob Bugge
    Community Expert
    November 25, 2011

    Harron.

    Inspiring
    June 18, 2009

    You might check out the JET_RandomFillSwatches script in this collection by James Talmage.

    New Participant
    June 18, 2009

    I think that script is a good start! Thank you! Have you used it though? I was wondering if you knew why it included black and transparent as colors in the random swatch group? Any way that I can work around this that you know of? Thank you!

    Known Participant
    August 10, 2010

    OK. Got it. Had to modify the script a bit more.

    RandomSwatchFill.gif

    As I wrote in the previous post, this is done with a random number generator, and that's not exactly what you want. But if you want to play with the script, here is the modified version:

    http://harron.home.acedsl.com/Misc/HKA_RandomSwatchFIll.zip

    Make sure you make the undeletable swatches -- [none] and [registration] -- the first two in the palette/panel.


    This link no longer works. Would you happen to have a working link for this script?