Thanks. I can pass in the color control to fill the shape, but if I want to use a lerpcolor between two chosen colors from the control it will throw an error ‘TYPEeRROR: undefined is not an object’
function setup() {
createCanvas(500, 500);
background(255);
}
function draw() {
background(options.Background);
fill(options.Foreground)
ellipse(100, 100, 50, 50);
let intermediate = lerpColor(options.Foreground, options.Background, 0.5);
fill(intermediate);
ellipse(200, 100, 50, 50);
}
If options.Foreground & options.Background are an array or a number or even a color string, you can convert them to a p5.Color datatype by passing them as an argument for color():