xxxxxxxxxx
31
const maxLength = 10;
const totalLines = 100;
const colors = [
'#840115',
'#800034',
'#00138a',
'#a381ff',
'#0a1db5'
]
function setup() {
createCanvas(600, 600);
background(0)
}
function draw() {
background(0, 10)
for (let i = 0; i < totalLines; i++) {
const p = createVector(random(width), random(height))
const c = color(colors[Math.floor(random(colors.length))])
c.setAlpha(random(10, 255))
stroke(c)
strokeWeight(random(1, 1.5))
line(p.x, p.y, random(p.x, maxLength), random(p.y, random(p.y, p.y +2)))
}
}