Quick selection between different colour palettes

Hi there!

Attached an example of a square grid with cells split into 5 groups - the distribution of which is randomized.

Each group of cells is given its own colour. What I’m trying to set up is a quick way of switching between different colour palettes that I have selected beforehand. In this example, each palette consists of 5 different colours.

What I am struggling with is how to control which colour palette gets used, instead of having to do so manually. I’d like to have a number slider as input that determines which palette gets used. I’ve added 5 examples of palettes that I’d like to be able to choose from. I’d appreciate any help!

colour palette 2022-09-10.gh (13.7 KB)

this might be one way, by creating a tree where each branch has 5 different colors, and using a slider to choose which branch data is to be sent to the preview

colour palette 2022-09-10_Re.gh (22.4 KB)


Perfect, thank you very much!