Last active
August 29, 2015 13:56
-
-
Save triss/8883949 to your computer and use it in GitHub Desktop.
fractal 0.1
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
// https://github.com/triss/colourlovers | |
import triss.colourlovers.*; | |
color[] colours; | |
int c; | |
void setup() { | |
size(1000, 1000); | |
noLoop(); | |
c = 0; | |
ColourLovers cl = new ColourLovers(this); | |
ColourLoversPalette pal = cl.getRandomPalette(); | |
println(pal.getId()); | |
colours = pal.getColours(); | |
} | |
void draw() { | |
background(255); | |
noStroke(); | |
translate(width / 2, height / 2); | |
rotate(radians(180)); | |
circs(7, height * 0.36, 3); | |
} | |
void circs(float rotations, float size, int depth) { | |
if(depth > 0) { | |
for(int r = 0; r < 360; r+= 360 / rotations) { | |
pushMatrix(); | |
rotate(radians(r)); | |
noStroke(); | |
translate(0, size / 2); | |
fill(colours[c++ % colours.length], 200); | |
ellipse(0, 0, size / 10, size / 2); | |
circs(rotations, size * 0.66, depth - 1); | |
popMatrix(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment