/* The Heart Beat */ float dir=-1; // direction of change float tinto=255; // start out red void setup( ){ size(500, 500); // set canvas background(64); // pick gray for the app frameRate(15); // more fun to go slow noStroke(); // show not lines fill(255,0,0); // start out pure red } void draw( ) { ellipse(200,250,100, 100); //piece together ellipse(300,250,100, 100); //a heart shape triangle(153, 270, 348, 270, 250, 400); //from basic shapes rect(240, 250, 20, 20); // tinto=tinto+dir*5; //set a new color if (tinto < 180 ) { //is it too dark? dir=1; //yes, start to lighten } if (tinto > 255) { //is it full color dir=-1; //start to darken } fill(tinto,0,0); //set the color }