xxxxxxxxxx
45
let colors = ["#00B6FF", "#0036FF", "#13DDFF", "#79C7FF", "#0A8BE2", "#00A3FF", "#1A35E3", "#013BD7","#F9FFF2"];
let a;
let b;
let positions = [];
let count = 20;
function setup() {
createCanvas(windowWidth, windowHeight);
let c = color(random(colors));
c.setAlpha(40);
background(c);
for(let i= 0;i<count;i++){
positions.push([random(0,width),random(0,height)]);
}
}
function draw() {
for(let i = 0;i<count;i++){
let x = random(0,150);
let y = random(0,200);
let h = random(70,80);
positions[i].push(x,y,h)
}
for(const [a,b,x,y,h] of positions){
drawLines(a,b,x,y,h);
}
}
function drawLines(a,b,x,y,h) {
push();
translate(a, b);
v = p5.Vector.random2D();
v.mult(random(x, y));
strokeWeight(4);
let c = color(random(colors));
c.setAlpha(random(0, h));
stroke(c);
line(0, 0, v.x, v.y);
pop();
}