You asked a simple question and you got simple answers!
If you expect more precise advices you must also expose the problem you want to solve more precisely.
I have 2 x 10 buttons
each 10 buttons must have the same color
I have 2 sets of 8 colors, in which i need to choose 2 colors
after I choose the color (by pressing the button)
the 10 buttons need to get the background color, from what I choose
same for the second 10 buttons
(total i need to choose 2 colors - 1 of 8 and again 1 of 8 colors)
each 10 buttons cannot have the same color as the other 10