color start = color(255, 0, 0); // outermost color color end = color(0, 0, 255); // innermost color float complexity = 10; // number of steps between colors float finalDiameter = 300; // size of outermost circle size(500,500); background(0); // for each shade... for( int i = 0; i < complexity; i++ ) { // calculate a decimal from 0 to 1 - this number will // increase incrementally to represent progress float ratio = i/complexity; // create a new color with the output from the lerpColor // interpolating function // we're using "ratio" to determine where along the // interpolated scale to look color currentShade = lerpColor(start, end, ratio); // then fill with that color fill(currentShade); // this next bit figures out a slightly smaller diameter each time float currentDiameter = finalDiameter-(ratio*finalDiameter); // and draws an ellipse with it ellipse(width/2, height/2, currentDiameter, currentDiameter); }