xxxxxxxxxx
const COL = createCols("https://coolors.co/885a89-8aa8a1-cbcbd4-d1b490-ee7b30");
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100);
// rectMode(RADIUS);
background(100);
}
function draw() {
for (let j = 0; j < 6; j++) {
for (let i = 0; i < 13; i++) {
let x = 100 + i * 100;
let y = 100 + j * 100;
noStroke();
fill(COL[int(random(COL.length))]);
rect(x, y, 80, 60, 60, 5, 15, 5);
}
}
for (let i = 0; i < 50; i++) {
let x = random(width);
let y = random(height);
let d = random(100);
strokeWeight(3);
stroke(0);
// noStroke();
rectMode(CORNER);
fill(random(360),50,80); // Set fill to white
// rect(25, 25, 50, 50,10);
rect(x, y, d, d, 15);
rectMode(CORNERS);
fill(random(56), 59, 95);
// rect(25, 25, 80, 50,5);
ellipse(x, y, d);
}
noLoop();
}
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;
}