Skip to content

Instantly share code, notes, and snippets.

@elsetiyawan
Created March 12, 2022 11:31
Show Gist options
  • Save elsetiyawan/8303a21466bb839d83546f61ff02aa56 to your computer and use it in GitHub Desktop.
Save elsetiyawan/8303a21466bb839d83546f61ff02aa56 to your computer and use it in GitHub Desktop.
generative_circle
function setup() {
createCanvas(window.innerWidth, window.innerHeight);
noLoop();
}
function draw() {
for (let i = 0; i < 30; i++) {
let top = random(windowHeight);
let bottom = random(windowWidth);
let size = random(20, 300);
let opacity = random(90);
fill(0, 0, 255, opacity);
noStroke();
ellipse(top, bottom, size, size);
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.min.js"></script>
html,
body {
height: 100%;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment