I'm trying to write a program in p5.js and my results are almost there however the last rectangles I get are too big. The image is what it should look like.
function setup() {
createCanvas(400, 400);
background(255);
}
function draw() {
noLoop()
stroke(0)
strokeWeight(0.5)
let x = 50
let y = 300
let w = 20
let h = 20
blueRange = 255
greenRange = 127
for(let i = 0;i <= 10;i++) {
fill(64,greenRange,blueRange)
rect(x,y,w,h)
x = x + w +(w/4)
y = y - h
h = h + h
greenRange = greenRange + 10
}
}