/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.s9DtHj$7jye/rev.2
*
* authors:
* Dee Cao
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
void setup(){
size(400, 400);
smooth();
}
void draw() {
background(0);
float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI;
float m = map(minute(), 0, 60, 0, TWO_PI) - HALF_PI;
float h = map(hour() % 12, 0, 12, 0, TWO_PI) - HALF_PI;
fill(255,5,55); // bottom right part
noStroke();
rect(200, 200, 200, 200);
fill(255,200,200);
rect(0,0,200,200);
fill(255,200,200,75);
rect(0,200,200,200);
//HOUR - bright red
pushMatrix();
stroke(255,76,59);
strokeWeight(4.5);
ellipse(cos(h)*125 + 200, sin(h)*125 + 200,20,20);
line(200, 200, cos(h)*125 + 200, sin(h)*125 + 200);
popMatrix();
//MIN - slight red
pushMatrix();
stroke(252,110,94);
strokeWeight(3);
line(200, 200, cos(m)*140 + 200, sin(m)*140 + 200);
ellipse(cos(m)*140 + 200, sin(m)*140 + 200,10,10);
popMatrix();
//SEC - pink pale
pushMatrix();
stroke(255);
strokeWeight(2);
line(200, 200, cos(s)*160 + 200, sin(s)*160 + 200);
ellipse(cos(s)*160 + 200, sin(s)*160 + 200,6,6);
popMatrix();
}