xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
/*strokeWeight(5);
stroke(255, 4 , 4 , 56);
fill(100 , 200 , 30 );*/
// 4 parametro per la trasparenza
background(98);
for (let x = 0; x < windowWidth; x = x + 50) {
stroke ( 100, map(x, 0, width, 0, 255), 50); // per la gradazione del colore
line(x, 0, mouseX, mouseY);
}
for( let x = 0; x < windowWidth; x= x + 50 ){
stroke ( 100, map(x, 0, width, 0, 255), 50);
line(x, windowHeight, mouseX, mouseY) ;
}
}