color[] mycolor = {color(int(random(255)),int(random(255)),int(random(255))),
color(int(random(255)),int(random(255)),int(random(255))),
color(int(random(255)),int(random(255)),int(random(255))),
color(int(random(255)),int(random(255)),int(random(255))),
color(int(random(255)),int(random(255)),int(random(255))),
color(int(random(255)),int(random(255)),int(random(255)))
};
void setup()
{
background(122,122,122);
size(600,600);
}
void draw()
{
background(122,122,122);
float x = mouseX;
float y = mouseY;
fill(0,0,255);
for (int i = 500; i > 0;i-=100){
color mycol = mycolor[i/100];
fill(mycol);
rect(x-i/2,y-i/2,i,i);
}
}
|