xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
noLoop();
//noStroke();
}
function draw() {
let counter = 0;
//let layerNumber = 0
let d = random([80, 100, 150]);
let xArray = [];
let yArray = [];
while (counter < 30) {
let x = random(0, windowWidth);
let y = random(0, windowHeight);
xArray.push(x);
yArray.push(y);
counter++;
}
drawACircles(xArray, yArray, d);
}
function drawACircles(xArray, yArray, d) {
for (let j = 0; j <= 4; j++) {
for (let i = 0; i < xArray.length; i++) {
let xp = xArray[i];
let yp = yArray[i];
console.log(j);
console.log(xp);
console.log(yp);
console.log(d);
drawLayer(j, xp, yp, d);
}
d -= 20;
}
}
function drawLayer(j, xp, yp, d) {
const palette = ["#92dce5", "#f7ec59",
"#FFE9CE", "#FFB5C2",
"#BFFFBC"
];
fill(palette[j]);
circle(xp, yp, d);
}