size(400,400); color left = color(232,154,28); // orange color right = color(155,16,198); // purple for (int x=0; x < width; x++) { float percent = 1.0 * x / (width-1); // force floating-point arithmetic stroke(lerpColor(left,right,percent)); line(x, 0, x, height); }