2008.09.29
processing sketch
Move your mouse over the sketch to change colors, and click to create complimentary colored boxes.
Code:
void setup()
{
size(555,400);
background(255);
smooth();
noFill();
frameRate(10);
}
void draw() {
for(int i=0; i<=width; i+=20){
if (mousePressed == true) {
float x=random(width);
float y=random(height);
float h=random(0,40);
fill(mouseY, mouseX, 100,y*.85);
rect(x,y,h,h);
} else {
float x=random(width);
float y=random(height);
float h=random(0,40);
fill(100, mouseY, mouseX,y*.85);
rect(x,y,h,h);
}
}
}