xxxxxxxxxx
35
let r = 0;
rectWH = 50;
function setup() {
createCanvas(600, 600);
angleMode(DEGREES);
}
function draw() {
background(240);
h = hour();
m = minute();
s = second();
translate(width/2, height/2);
rotate(r-90); // rotate the degree diagram to match the clock
noStroke();
//second
fill(255, 255, 0, 80);
arc(0, 0, 400, 400, 0, s*6); // 360 degrees divided by 60 seconds is 6
//minute
fill(204, 204, 255, 80);
arc(0, 0, 350, 350, 0, m*6); // 360 degrees divided by 60 minutes is 6
//hour
fill(204, 255, 245, 80);
arc(0, 0, 300, 300, 0, h*15); // 360 degrees divided by 24 hours is 15
print(h, m, s);
}