/* In this variant on moving_circles, the circle becomes the sun, and the color of the sun and the background varies with the height of the sun. */ color sunHigh = color(245, 234, 12); // yellow color sunLow = color(234, 148, 7); // orange color skyHigh = color(164, 236, 243); color skyLow = color(211, 136, 165); // This function is executed only once, at the very beginning void setup() { size(500, 400); noStroke(); } // This function is repeatedly call in an implicit loop. // A single call is responsible for drawing a single frame. void draw() { float t = pow(float(mouseY) / height, 4); background(lerpColor(skyHigh, skyLow, t)); fill(lerpColor(sunHigh, sunLow, t)); float r = 50 + t*20; // gets bigger near bottom ellipse(mouseX, mouseY, r, r); }