xxxxxxxxxx
26
let step = 0.001;
let amount = 0;
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
if (amount > 1 || amount < 0) {
step *= -1;
}
amount += step;
let red = color(255, 0, 0);
let blue = color(0, 255, 0);
let redBlueLerp = lerpColor(red, blue, amount);
let blueRedLerp = lerpColor(blue, red, amount);
background(redBlueLerp);
for (let i=0; i<windowWidth; i += 20){
fill(blueRedLerp);
rect(i, 0, 10, windowHeight);
}
}