let url = ["https://coolors.co/264653-2a9d8f-e9c46a-f4a261-e76f51",
"https://coolors.co/006d77-83c5be-edf6f9-ffddd2-e29578",
"https://coolors.co/355070-6d597a-b56576-e56b6f-eaac8b",
"https://coolors.co/1a535c-4ecdc4-f7fff7-ff6b6b-ffe66d",
colorMode(HSB, 360, 100, 100, 100);
while (points.length < points_num) {
let x = random(-offset, width + offset);
let y = random(-offset, height + offset);
let depth = random(2, 6);
let p = new Point(x, y, d, depth);
let distance = dist(p.x, p.y, op.x, op.y);
if (distance < p.d / 2 + op.d / 2) {
palette = shuffle(createPalette(random(url)), true);
drawNodes(p.x, p.y, p.d, p.depth);
dc.shadowColor = color(0, 0, 0, 33);
dc.shadowBlur = width / 20;
function drawNodes(x, y, d, depth) {
let colors = shuffle(palette.concat());
let n = int(random(2, 9));
for (let i = 0; i < n; i++) {
let angle2 = random(360);
let nx = cos(angle) * d / 3;
let ny = sin(angle) * d / 3;
stroke(colors[i % colors.length]);
let x2 = cos(a1) * d / 3 / 2;
let y2 = sin(a1) * d / 3 / 2;
let nx2 = nx + cos(a2) * d / 3 / 2;
let ny2 = ny + sin(a2) * d / 3 / 2;
fill(colors[(i + 1) % colors.length]);
circle(0, 0, max(d / 8 / 3, 5));
if (depth > 0 && d / 3 > 3) {
drawNodes(nx, ny, d / 3, depth - 1);
fill(colors[(i + 2) % colors.length]);
circle(nx, ny, max(d / 8 / 3, 3));
constructor(x, y, d, depth) {
circle(this.x, this.y, this.d);
function createPalette(_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] = color('#' + arr[i]);