xxxxxxxxxx
void setup () {
size(800,800);
background(255);
smooth();
}
void draw () {
//Draw the background
fill(255);
noStroke();
rect(0,0,width,height);
hour_();
minute_();
second_();
}
void hour_(){
noFill();
stroke(24,64,3);
strokeWeight(1);
if (hour()==0||hour()==12){
fill(255);
stroke(115,124,117);
strokeWeight(2);
arc(400,400,600,600, PI*5/6, PI*7/6, OPEN);
}else if (hour()<12){
for (int i=0;i<hour()+1;i++){
arc(400,400,i*50,i*50, PI*5/6, PI*7/6, OPEN);
}
}else if (hour()>12){
for (int i=0;i<hour()-11;i++){
arc(400,400,i*50,i*50, PI*5/6, PI*7/6, OPEN);
}
}
}
void minute_(){
if(minute()==0){
fill(1);
noStroke();
arc(400, 400,601,601,-PI*5/6,PI*5/6, OPEN);
}else{
for (int i=0;i<minute()+1;i++){
noFill();
stroke(80,88,82);
if(i%5==0){
strokeWeight(1);
arc(400, 400,i*10,i*10,-PI*5/6,PI*5/6, OPEN);
}else{
strokeWeight(0.5);
arc(400, 400,i*10,i*10,-PI*5/6,PI*5/6, OPEN);
}
}
}
}
void second_(){
if (second()==0){
noFill();
noStroke();
strokeWeight(0.1);
arc(400, 400,601,601,-PI*5/6,PI*5/6, OPEN);
}else{
for (int i=1;i<second()+1;i++){
noFill();
stroke(66,167,92);
if (i%5==0){
strokeWeight(1.1);
arc(400, 400,i*10,i*10, -PI*5/6,PI*5/6, OPEN);
}else{
strokeWeight(0.3);
arc(400, 400,i*10,i*10,-PI*5/6,PI*5/6, OPEN);
}
}
}
}