Last active
November 1, 2017 17:53
-
-
Save jacopocolo/f830152d533889c0bcabc46539141516 to your computer and use it in GitHub Desktop.
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
//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