let hr, min, sec, zm; function preload() { hr = hour(); mint = minute(); sec = second(); zm = 255; } function setup() { noStroke(); createCanvas(600,500); background(255); } function draw() { background(255); push(); let sec = second(); let s = map(second(), 0, 60, 0, 600); if (sec % 2 > 0) { fill(second(), second() * 7, second()); } else { fill(second(), second(), second() * 7); } ellipse(s, 100, second() * 5/3, second() * 5/3); let min = minute(); let m = map(minute(), 0, 60, 0, 600); if (min % 2 > 0) { fill(minute() * 7, minute(), minute()); } else { fill(minute(), minute() * 7, minute() * 7); } ellipse(m, 250, minute() * 5/3, minute() * 5/3); let hr = hour() - 2; let h = map(hour() - 2, 0, 23, 0, 600); if (hr % 2 > 0) { fill(hour(), hour() * 7, hour()); } else { fill(hour() * 7, hour(), hour() * 7); } ellipse(h, 400, hour() * 4.35, hour() * 4.35); pop(); fill(zm); textAlign(CENTER); textSize(32); textStyle(BOLD); text(nf(hr, 2, 0) + ':' + nf(min, 2, 0) + ':' + nf(sec, 2, 0), 100, 50); } function keyPressed() { if( key == ' ' || key == ' ' ) { zm = 0; } } function keyReleased() { if( key == ' ' || key == ' ' ){ zm = 255; } }