int cols = 10; int rows = 10; int rectSize; void setup() { size(400, 400); rectSize = width / cols; noLoop(); // We don't need to continuously redraw the pattern } void draw() { background(255); for (int i = 0; i < cols; i++) { for (int j = 0; j < rows; j++) { int x = i * rectSize; int y = j * rectSize; float redColor = map(i, 0, cols-1, 0, 255); // Modify red based on column index float greenColor = map(j, 0, rows-1, 0, 255); // Modify green based on row index fill(redColor, greenColor, 150); // Vary color based on position rect(x, y, rectSize, rectSize); } } save("activity13.png"); }