function setup() {
createCanvas(500, 350);
textSize(18);
text("From Color", 20, 20);
fromColor = color("red");
text("Lerped Color", 150, 20);
text("To Color", 300, 20);
toColor = color("blue");
text("Adjust this slider to change the"+
" amount of lerping", 20, 200)
alphaSlider = createSlider(0, 100, 50);
alphaSlider.position(20, 220);
alphaSlider.style('width', '250px');
}
function draw() {
lerpedColor = lerpColor(fromColor, toColor, alphaSlider.value() / 100);
fill(fromColor);
rect(30, 30, 50, 100);
fill(lerpedColor);
rect(170, 30, 50, 100);
fill(toColor);
rect(310, 30, 50, 100);
}