nick34992
4/19/2016 - 4:10 PM

Stack X-Axis Parameter. Using p5.js library.

Stack X-Axis Parameter. Using p5.js library.

function setup() {
  createCanvas(320, 180);
}

function draw() {
  background(0);
  noStroke();
  var x = 35;
  // shades of grey increase by approx 42.5 increments
  fill(42);
  ellipse(x, 90, 50, 50);
  // x position increases by 50 pixel increments
  x = x + 50;
  fill(85);
  ellipse(x, 90, 50, 50);
  x = x + 50;
  fill(127);
  ellipse(x, 90, 50, 50);
  x = x + 50;
  fill(170);
  ellipse(x, 90, 50, 50);
  x = x + 50;
  fill(212);
  ellipse(x, 90, 50, 50);
  x = x + 50;
  // final ellipse is white
  fill(255);
  ellipse(x, 90, 50, 50);
  x = x + 50;
}