nick34992
4/19/2016 - 3:52 PM

Color Ellipse Array. Using p5.js library.

Color Ellipse Array. Using p5.js library.

var cir = [];

function setup() {
  createCanvas(1152, 648);
  for (var i = 0; i < 400; i++)
  cir[i] = {
    x: random(0, width),
    y: random(0, height),
    display: function() {
      noStroke();
      fill(color(random(255), random(255), random(255), 100));
      ellipse(this.x, this.y, 60, 60);
    }
  }
}

function draw() {
  background(0);
  for (var i = 0; i < cir.length; i++) {
    cir[i].display();
    frameRate(5);
  }
}