int hours;
String period;
int r = 0;
int b = 0;
int g = 0;
float rchanger;
float gchanger;
float bchanger;
float rchanger2;
float gchanger2;
float bchanger2;
void setup(){
size(800,800);
rchanger = 0;
gchanger = 0;
bchanger = 0;
rchanger2 = 0;
gchanger2 = 0;
bchanger2 = 0;
}
void draw(){
rchanger = map(second(), 0, 30, 205, 0);
gchanger = map(second(), 0, 30, 201, 0);
bchanger = map(second(), 0, 30, 255, 0);
rchanger2 = map(second(), 30, 60, 0, 205);
gchanger2 = map(second(), 30, 60, 0, 201);
bchanger2 = map(second(), 30, 60, 0, 255);
background(255);
hours= hour();
if (hour() > 12){
hours = hour() - 12;
period = "PM";
}else{
hours = hour();
period = "AM";
}
{
println(hours + ":" + minute() + ":" + second() + period);
background (255, 255, 230);
textAlign(CENTER);
fill (0);
text(hours + ":" + minute() + ":" + second() + " " + period, width/2, height/2);
// jump1();
// jump2();
// jump3();
dimmer();
//create variable for hour minuetes and seconds
}
}
void dimmer(){
fill(rchanger, gchanger, bchanger);
if(second() <= 30){
strokeWeight(0); stroke(0,0,0,0);
fill(rchanger, gchanger, bchanger);
rect(0,0,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,66.7,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,133.4,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,200.1,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,266.8,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,333.5,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,400.2,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,466.9,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,466.9,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,533.6,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,600.3,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,677,width,150);
fill(rchanger, gchanger, bchanger);
rect(0,733.7,width,150);
}else if (second() <= 60){
strokeWeight(0); stroke(0,0,0,0);
fill(rchanger2, gchanger2, bchanger2);
rect(0,0,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,66.7,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,133.4,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,200.1,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,266.8,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,333.5,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,400.2,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,466.9,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,466.9,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,533.6,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,600.3,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,677,width,150);
fill(rchanger2, gchanger2, bchanger2);
rect(0,733.7,width,150);
}
}
/* fill(mouseY-70,mouseY-50,mouseY);
/stroke(0,0,0,0); strokeWeight(0);
fill(#03A9FF,120);
// rect(0,0,width,500);
fill (255,255,240); ellipse (250, 250, 5,5);
ellipse (470, 200, 5,5);
ellipse (780, 60, 5,5);
ellipse (100, 30, 5,5);
ellipse (600, 380, 5,5);
ellipse (360, 300, 5,5);
ellipse (400, 20, 5,5);
ellipse (550, 150, 10,10);
ellipse (500, 100, 10,10);
ellipse (300, 20, 10,10);
ellipse (660, 370, 10,10);
ellipse (750, 260, 10,10);
ellipse (10, 240, 10,10);
ellipse (490, 320, 10,10);
ellipse (170, 280, 10,10);
ellipse (90, 250,10,10);
*/
No comments:
Post a Comment