size(400, 400); for (int x=0; x < width; x++) { for (int y=0; y < height; y++) { float percentX = 1.0 * x / width; float percentY = 1.0 * y / height; stroke(255*percentX, 255*percentY, 255*(1-percentX)*(1-percentY)); point(x, y); } }