xxxxxxxxxx
23
let steps = 20; // try changing this number
let to;
let from;
function setup() {
createCanvas(400, 400);
noStroke();
to = color("#B8D4E3");
from = color("#66101F");
}
function draw() {
for (let i = 0; i < steps; i++) {
let colour = lerpColor(to, from, i/(steps-1));
fill(colour);
rect(i*width/steps, 0, width/steps, height);
}
}