void setup() { size(900,500); // size of backrground } void draw() { int s=second(); int m=minute(); int h=hour() % 12; float b=(3-h)*PI/6; float c=(h-3)*PI/6; int a = 59-m; background(0); smooth(); fill(140); stroke(255); strokeWeight(2); rectMode(CENTER); rect(450,250,400,400); // square if((h>=0)&(h<=3)) { fill(255); stroke(0); strokeWeight(2); arc(450,250,330,330,TWO_PI-HALF_PI,TWO_PI-b); } else { fill(255); stroke(0); strokeWeight(2); arc(450,250,330,330,TWO_PI-HALF_PI,TWO_PI); arc(450,250,330,330,0,c); } //hour stroke(255); for (int i = 7; i <= 15*s; i += 15) { strokeWeight(10); strokeCap(ROUND); line(i,15,i,30); line(i,470,i,485); } // second stroke(0); strokeWeight(2); line(450,50,450,450); line(250,250,650,250);// two lines strokeWeight(7); stroke(0); noFill(); ellipse(450,250,360,360); ellipse(450,250,330,330);// two circles PFont font; font = loadFont("Arial-Black-48.vlw"); textFont(font); fill(0); textSize(150); if(a >= 10) { text(a, 355, 300); }else { text(a,400,300); } // minute }