xxxxxxxxxx
37
//9/23/20 tale
function setup() {
createCanvas(600, 600);
}
function draw() {
colorMode(RGB);
let start = color("#512E5F");
let end = color("#A3E4D7");
background(50);
let fillColor;
let strokeColor;
let wid=15;
let hei=150;
let x = 75;
let y = 400;
let num = 30;
for (var i=0; i<num; i++){
fillColor = lerpColor(start, end, 1/num*i);
fill(fillColor);
stroke(150);
let xp = x + i*wid;
let yp;
let h;
if ((i-(num/2)-1)<0){
yp = y - i*wid;
h = hei + i*wid;
}else {
yp = y - num*wid + i*wid;
h = hei + num*wid - i*wid;
}
rect(xp,yp,wid,h);
}
}