How do i add colour to each one of the 10 boxes i made

please format code with </> button * homework policy * asking questions

void setup(){
size(500,500);
}
void draw(){
for(int i=0;i<=450;i+=50){
rect(0,i,50,50);
}
}

Hi, just use fill() above the rect() with a variable.
Like: fill(i/2, i/4, 0);

Thanks but I want each box to have a different colour not a range like box 1 black box 2 red and so on using the colour selector.

Make an array of colors and access the color as fill parameter like

for(int i = 0; i <= 450; i += 50){
  int index = int(map(i, 0, 450, 0, myColoArray.length));
  fill(myColorArray[index];
  rect(0,i,50,50);
}