xxxxxxxxxx
const COL = createCols("https://coolors.co/bac1b8-58a4b0-0c7c59-2b303a-d64933");
let palette = ["#b8d8ba", "#d9dbbc", "#fcddbc", "#ef959d", "#69585f"]; //https://coolors.co/b8d8ba-d9dbbc-fcddbc-ef959d-69585f
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100);
frameRate(5);
background(0,0,100);
}
function draw() {
// noStroke();
strokeWeight(3);
for (let j = 0; j < 20; j++) {
for (let i = 0; i < 20; i++) {
let x = (i * 100) + 30;
let y = (j * 100) + 40;
if (random(10) < 0.5) {
// fill(177, 58, 91);
fill(COL[int(random(COL.length))]);
arc(x, y, 80, 80, 0, HALF_PI, CHORD);
// arc(x,y, 80, 80, 0, PI + QUARTER_PI, CHORD);
} else
if (random(10) < 0.5) {
// fill(0, 64, 95);
fill(45, 60, 95);
arc(x, y, 100, 100, HALF_PI, PI, CHORD);
} else
if (random(5) < 0.5) {
// fill(56, 59, 95);
arc(x, y, 70, 70, PI, PI + QUARTER_PI, CHORD);
} else {
if (random(1) < 0.5) {
// fill(45, 60, 95);
fill(random(palette));
arc(x, y, 120, 120, PI + QUARTER_PI, TWO_PI,CHORD);
}
}
}
}
}
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;
}