Last active
December 14, 2015 04:39
-
-
Save bdaver/5029733 to your computer and use it in GitHub Desktop.
VCD 293 Design by Code
Week 3 Workshop Example
Arrays, Colors, Random
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
| // 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