Random color from given

Hello.
I try to create flash function. I implemented few colors and now I want display them in random order.
What way is good to do it? Do arrays like these are good idea to choose random color?

int white[3]  = { 255, 255, 255 };
int red[3]    = { 255, 0, 0 };
int green[3]  = { 0, 255, 0 };
int blue[3]   = { 0, 0, 255 };
int orange[3] = { 250, 37, 0 };
int pink[3] = { 172, 0, 106 };
int greenblue[3] = { 1, 170, 40 };
int purple[3] = { 190, 41, 236 };


int redPin = 9;
int greenPin = 10;
int bluePin = 11;


void setup() {

    Serial.begin(9600);
}

void loop() 
{
  

      light(white);
      light(orange);
      light(purple);
      
}

void light(int color[3]) 
{
	int r = color[0];
	int g = color[1];
	int b = color[2];

    Serial.print(r);Serial.print(",");Serial.print(g);Serial.print(",");Serial.println(b);

    analogWrite(redPin, r);  
    analogWrite(greenPin, g);      
    analogWrite(bluePin, b);
   
   delay(1000); 

}

Amount of colors can be bigger od course.

Hello,

No, that way will not make a random colour selection easy, or at least not short.

You need to go one step further. A 2-dimensional array. The first index will be the sequence number of the colour. The second dimension will be the r, g & b components of that colour, like your arrays are now.

Then you can select a random colour sequence number and get the r, g & b components from the array at that position.

You can think of a 2-dimensional array as like a spreadsheet. Each row in the sheet is one of your colours. The 3 columns contain the r, g & b values.

Paul