xxxxxxxxxx
27
let colors = [];
function setup() {
createCanvas(windowWidth, windowHeight);
colors = [
color(128, 0, 128), // Deep purple
color(147, 112, 219), // Medium purple
color(230, 230, 250) // Light purple
];
noStroke();
}
function draw() {
background(255);
// Simple diagonal gradient with smooth transitions
for (let x = 0; x < width; x += 1) {
let inter = map(x, 0, width, 0, 1);
let gradientColor = lerpColor(colors[0], colors[1], inter);
fill(gradientColor);
rect(x, 0, 1, height);
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}