/* line_gradient.pde Edited by Justin Hsia (orig. Larry Snyder) Use a for-loop to draw vertical lines using a stroke gradient */ size(500,500); background(255); strokeWeight(5); for(int i=25; i <= width; i = i + 25) { //stroke(i*25); // option 1: start i = 1, update i = i + 1 //line(i*25,0,i*25,height); // i represents the line number // first: line(25,0,25,height) // second: line(50,0,50,height) // third: line(75,0,75,height) // etc. stroke(i); // option 2: start i = 25, update i = i + 25 line(i,0,i,height); // i represents x-position }