xxxxxxxxxx
const COL = createCols("https://coolors.co/ef6351-f38375-f7a399-fbc3bc-ffe3e0");
let bg;
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100);
}
function draw() {
background(frameCount % 360, 50, 100, 30);
move();
}
function move() {
push();
frameRate(3);
translate(width * 0.5, (height * 0.05) - 140);
rotate(PI / 3.0);
rect(width * 0.1, height * 0.1, 500, 500, 50);
fill(COL[int(random(COL.length))]);
stroke(random(360), 40, 100, 50);
strokeWeight(5);
drawingContext.clip();
for (let i = 0; i < 1000; i++) {
let x = random(width);
let y = random(height);
let angle = random(360)
push();
translate(x, y);
rotate(angle);
rect(x - 10, y, 30, 30, 10);
pop();
}
pop();
}
function createCols(_url) {
let slash_index = _url.lastIndexOf('/');
let pallate_str = _url.slice(slash_index + 1);
let arr = pallate_str.split('-');
for (let i = 0; i < arr.length; i++) {
arr[i] = '#' + arr[i];
}
return arr;
}