xxxxxxxxxx
31
function setup() {
createCanvas(400, 400);
background(32, 65, 90);
strokeWeight(3);
textFont("Georgia");
}
function drawTime(amount, low, high, stk, fll) {
push();
rotate(map(amount, 0, high, -PI / 2, TWO_PI - PI / 2));
stroke(stk);
fill(fll);
text(nf(amount, 2), 0, 0);
pop();
}
function draw() {
let h = hour();
let m = minute();
let s = second();
background(32, 65, 90, 65);
translate(width / 2, height / 2);
textSize(92);
drawTime((h % 12) == 0 ? '12' : (h%12), 0, 12, 0, color(220, 212, 195));
textSize(148);
drawTime(m, 0, 60, 0, color(220, 212, 195));
textSize(136);
drawTime(s, 0, 60, color(185, 90, 90), color(185, 90, 90, 156));
}