xxxxxxxxxx
29
function setup(){
createCanvas(500, 500);
colorMode(HSB);
background(51);
}
let x = 0;
let y = 0;
const points = [];
function draw(){
points.push({x,y});
x = (x + 10) % width;
if(x === 0){
y = (y + 10) % height;
}
let hu = 0;
noFill();
strokeWeight(2);
beginShape();
points.forEach(({x,y})=>{
stroke(hu, 255, 255);
point(x,y);
hu += 0.1;
if(hu > 255) hu = 0;
})
endShape();
}