Skip to content

Instantly share code, notes, and snippets.

@bdaver
Last active December 14, 2015 04:39
Show Gist options
  • Save bdaver/5029733 to your computer and use it in GitHub Desktop.
Save bdaver/5029733 to your computer and use it in GitHub Desktop.
VCD 293 Design by Code Week 3 Workshop Example Arrays, Colors, Random
// VCD 293 Design by Code
// Week 3 Workshop Example
// Arrays, Colors, Random
// Made with processing
color[] colors = { #28251E, #49B4A2, #8FD783, #CEEF24, #E9DEC0 };
void setup() {
size(600,600);
background(255);
}
void draw() {
pushMatrix();
translate(random(width),random(height));
int index = int(random(colors.length));
circ(colors[index]);
popMatrix();
}
void circ(color c) {
noStroke();
fill(c);
ellipse(0,0,100,100);
fill(255);
ellipse(0,0,90,90);
fill(c);
ellipse(0,0,80,80);
fill(255);
ellipse(0,0,65,65);
fill(c);
ellipse(0,0,50,50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment