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; float percentDiff = abs(percentX-percentY); stroke(255*(1-percentY), 255*percentDiff, 255*(1-percentX)); point(x, y); } }