Created
March 18, 2011 16:26
-
-
Save alfanick/876362 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ws = 640; | |
int st = 20; | |
int ed = 1; | |
int sd = 10; | |
void setup() { | |
size (ws, ws); | |
noStroke(); | |
} | |
void draw() { | |
} | |
void keyPressed() { | |
for (int i = 0; i < ws; i += st) | |
for (int j = 0; j < ws; j += st) { | |
float c = random(100); | |
if (c < ed) | |
fill (random(10, 50), random(10, 50), random(10, 50)); | |
else if (c < sd) | |
fill (random(50, 100), random(50, 100), random(50, 100)); | |
else | |
fill (random(100, 255), random(100, 255), random(100, 255)); | |
rect(i, j, i + st, j + st); | |
} | |
saveFrame("avatar-####.png"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment