I understand now. Tyvm @glv! I managed to recreate the pattern you’ve screenshotted and my desired pattern!
// Loop for Rectangle Generation
size (500, 400);
background(100);
// Loop for Rectangle Generation
for (int y = 0; y < height; y = y + 40) //rows
{
for (int x = 0; x < width; x = x + 150) //columns 3*50 = 150 for 3 color columns at a time
{
println(x, y);
fill(0, 255, 0); //Green
rect(x, y, 50, 40);
fill(255, 0, 0); //Red
rect(x+50,y, 50, 40); // What is the ? spacing Add or multiply? How much?
fill(0, 0, 255); // Blue
rect(x+100, y, 50, 40); // What is the ? spacing Add or multiply? How much?
}
}
For the Red then Blue then Green pattern:
// Loop for Rectangle Generation
size (500, 400);
background(100);
// Loop for Rectangle Generation
for (int y = 0; y < height; y = y + 40) //rows
{
for (int x = 0; x < width; x = x + 150) //columns 3*50 = 150 for 3 color columns at a time
{
println(x, y);
fill(0, 255, 0); //Green
rect(x+100, y, 50, 40);
fill(255, 0, 0); //Red
rect(x,y, 50, 40); // What is the ? spacing Add or multiply? How much?
fill(0, 0, 255); // Blue
rect(x+50, y, 50, 40); // What is the ? spacing Add or multiply? How much?
}
}
I was asking myself, why was it 150 till I saw the note. Is my interpretation right? Since it’s 50 per box, the loop divides the 150 to three. Then assigns a color in 3 boxes and repeats them. Well, I’ll still be experimenting… I’ll try to add variations in the colors now.
Thank you for explaining~