I have been teaching myself JavaScript, and I like the idea of code-generated art. I came across this design that is made up of circles changing in size and overlapped by different colors.
How would something like this reference image:

Can this be coded in JavaScript? I'm guessing for loops? But I am not sure how to set them to gradually change sizes throughout the line.
I'm imagining something like this?
let spaceX = 25,
spaceY = 25,
dial = 20;
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(220);
// horizontal row
for (let x = 0; x <= width; x += spaceX) {
// vertical column
for (let y = 0; y <= height; y += spaceY) {
ellipse(x, y, diam);
}
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script>
Here's the pseudo-code translated to JavaScript with Canvas