Skip to content

Instantly share code, notes, and snippets.

@alfanick
Created March 18, 2011 16:26
Show Gist options
  • Save alfanick/876362 to your computer and use it in GitHub Desktop.
Save alfanick/876362 to your computer and use it in GitHub Desktop.
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