Skip to content

Instantly share code, notes, and snippets.

@masaakif
Created January 13, 2009 03:03
Show Gist options
  • Save masaakif/46301 to your computer and use it in GitHub Desktop.
Save masaakif/46301 to your computer and use it in GitHub Desktop.
int value = 0;
void setup() {
size(800, 800);
randomSeed(0);
noLoop();
}
void draw() {
float cX = mouseX;
float cY = mouseY;
float len = random(10,25);
translate(cX-len/2, cY-len/2);
float rad = random(0, PI*2);
rotate(rad);
rect(0, 0, len, len);
float fr = random(0,255);
float fg = random(0,255);
float fb = random(0,255);
fill(color(fr,fg,fb));
}
void mouseDragged()
{
value = value + 5;
if (value > 255) {
value = 0;
}
redraw();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment