ICC
< back to sketch

float value;
float s;
int q;

void  setup (){
  size (300,300);
  background (255,255,255);
  smooth();
  for(float a=1;a<300;a+=6){
    noStroke();
    fill(255,a,0,30);
    rect(a,0,10,300);
  }
  for(float b=1;b<300;b+=6){
    noStroke();
    fill(s,mouseY,255,30);
    rect(0,b,300,10);
  }

}

void loop (){

  //background(255);

  for(int a=10;a<300;a+=30){
    noStroke();
    fill(255,mouseX,0,10);
    rect(a*value,0,1*s,300);
  }
  for(int b=10;b<300;b+=30){
    noStroke();
    fill(s,mouseY,255,10);
    rect(0,b*value,300,1*s);
  }

  //println(value);

}
void keyPressed (){

  if(key==UP){
    if(value>29.8){
      value=29.8;
    }
    value=value+0.09;
    s=s+0.25;
  }

  if(key==DOWN){

    if(value<-0.001){
      value=-0.001;
    }

    value=value-0.09;
    s=s-0.25;
  }

}

< back to sketch