Created
January 13, 2009 03:03
-
-
Save masaakif/46301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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