xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(255);
strokeWeight(3);
for(let x = 0; x < width; x = x + 20){
if(x <= width/2){
stroke(map(x, 0, width, 0, 255), 64, 52, x);
}
else{
stroke(235, map(x, 0, width, 0, 255), 52, x);
}
line(mouseX, mouseY, x, 0);
if(x <= width/2){
stroke(235, map(x, 0, width, 0, 255), 52, x);
}
else{
stroke(128, 52, map(x, 0, width, 0, 255), x);
}
line(mouseX, mouseY, x, height);
}
}