xxxxxxxxxx
// based on https://gist.github.com/todbot/4f80d456289956bcec26b868f38c7ce2
var num_colors = 5;
var llen = 20;
let palette = [
'#000000', // black
'#ff0000', // red
'#0000ff', // blue
'#ff00ff', // purple
'#00ff00' // green
];
var x, y, c;
function drawL(x, y, l, c) {
// strokeWeight(1);
stroke(c);
line(x, y, x + l, y);
line(x, y, x, y - l);
}
function setup() {
colorMode(RGB);
frameRate(120);
createCanvas(windowWidth / 2, windowHeight / 2);
background('#000000');
}
function draw() {
c = random(palette);
x = random((windowWidth - llen)/2);
y = random((windowHeight - llen)/2);
drawL(x, y, llen, c);
}