Assigning material randomly

How would I randomly assign all of these cubes different materials? I want them all to be glass of different colours, they are all collected into 1 layer

Hi Saffie,

We’ll need a little information to be able to properly assist.

Hey sorry, i havnt touched grasshopper in about a year and dont really remember what im doing.

i found a couple of similar examples like this but i dont really know what im looking at.

i want to assign these cubes with a random coloured glass material

heres my file with the cubes, any help is really appreciated

model.3dm (5.7 MB)

here is a quick way..

Typically you would have a set of colors and then jitter to create the randomness, often designers will specify a % of the colors in the set.
RandomColor-R8.gh (7.9 KB)

thank you so much, this is a perfect start! time to play around with it!

Another quick version.


RandomColor-R8-v2.gh (11.6 KB)

note you can query and assign Rhino materials as well.