/* Valentines Lines 2.0 */ int i; // iteration variable float fli; // floating point iteration variable float whitescale; // line color variable float colpick; // color picking variable void setup( ){ size(400, 500); // set canvas background(0); // pick black for background frameRate(2); // more fun to go slow strokeWeight(2); // wide lines better } void draw( ) { colpick = random(0,1); // pick a value which will code for a color whitescale = int(random(0,255)); // whiteness of this run if (colpick < 0.15) { stroke(128,0,128); // Pick color purple } else if (colpick < 0.66){ stroke(255,whitescale,whitescale);// Pick color on red-scale } else { stroke (255,whitescale,255); // Pick color on purple-scale } fli = random(1,10); // choose number of lines for (i = int(fli); i > 0; i--) { // Do a random-numbered batch between 1 and 10 line(random(1,399), random(1, 499), random(1,399), random(1, 499)); } //Heart frame noStroke(); fill(0); triangle(0,150,0,500,200,500); triangle(400,150,400,500,200,500); beginShape(); curveVertex(0,150); curveVertex(0,150); curveVertex(5,75); curveVertex(30,30); curveVertex(100,0); curveVertex(170,30); curveVertex(200,75); curveVertex(200,75); vertex(200,0); vertex(0,0); vertex(0,150); endShape(CLOSE); beginShape(); curveVertex(400,150); curveVertex(400,150); curveVertex(395,75); curveVertex(370,30); curveVertex(300,0); curveVertex(230,30); curveVertex(200,75); curveVertex(200,75); vertex(200,0); vertex(400,0); vertex(400,150); endShape(CLOSE); }