xxxxxxxxxx
var w
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
w=300
}
function draw() {
rect(300,300,w,20)
fill(0,255,0)
if (w>200)
fill(0,255,0)
else if(w<200 && w>100)
fill(190, 252, 3)
else if(w<100)
fill(255,0,0)
if (w>1)
w=w-1
}