Skip to content

Instantly share code, notes, and snippets.

@jacopocolo
Last active November 1, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacopocolo/f830152d533889c0bcabc46539141516 to your computer and use it in GitHub Desktop.
Save jacopocolo/f830152d533889c0bcabc46539141516 to your computer and use it in GitHub Desktop.
//color palette from https://klart.co/colors/59c774786fb55d3948befd3b
var colors = ["#246A9E","#8BB3C8","#9E5C71","#FC9C78","#F1F2F9"];
var colIdx = 0;
var angle = 0;
var maxDist = 0;
var diam = 8;
var rate = 0.13;
var chance = 0.75;
function setup() {
createCanvas(400, 400);
strokeWeight(2);
noFill();
background(0);
}
function draw(){
maxDist = 700;
translate(width/2,height/2);
for(dist=50;dist<200;angle+=1){
if(random()>0.75){
var x = sin(angle) * dist;
var y = cos(angle) * dist;
stroke(colors[colIdx]);
stroke(colors[floor(random(5))]);
ellipse(x, y, diam, diam);
if (random()>0.98) {
dist=dist+25;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment