"https://coolors.co/0081a7-00afb9-fdfcdc-fed9b7-f07167",
colorMode(HSB, 360, 100, 100, 100);
texture = createGraphics(width, height);
texture.colorMode(HSB, 360, 100, 100, 100);
texture.stroke(0, 0, 100, 15);
for (let i = 0; i < width * height * 5 / 100; i = i + 1) {
texture.strokeWeight(random(3));
texture.point(random(width), random(height));
palette = shuffle(createPalette(random(url)), true);
let d = width - 2 * offset;
drawingContext.shadowColor = color(0, 0, 0, 25);
drawingContext.shadowBlur = offset / 2;
recursiveRect(x, y, d, this);
function recursiveRect(x, y, d, g) {
let step = int(random(1, 4));
for (let j = 0; j < step; j++) {
for (let i = 0; i < step; i++) {
if (random(100) < 90 && w > width / 3) {
recursiveRect(nx, ny, w, g);
drawSteppedGraphic(nx + w / 2, ny + w / 2, w);
function drawSteppedGraphic(cx, cy, d) {
let g = createGraphics(d, d, WEBGL);
let camera = g.createCamera();
g.colorMode(HSB, 360, 100, 100, 100);
g.ortho(-width / 2, width / 2, -height / 2, height / 2, -2000, 2000);
camera.setPosition(0, -250, 500);
let dir = random() > 0.5 ? -1 : 1;
let N = int(random(3, 8));
let m = int(random(N + 1, N * N));
let arr = generateHeightMap(N);
let colors = shuffle(palette.concat(), true);
g.directionalLight(colors[0], 0, 0, -1);
g.directionalLight(colors[1], 0, 1, 0);
g.directionalLight(colors[2], 1, 0, 0);
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr[i].length; j++) {
let z = map(i, 0, arr.length, -200, 200);
let x = map(j, 0, arr[i].length, -200, 200);
let d = arr[i][j] * (400 / N) + 1;
g.translate(0, -d / 2 - w / 2 - w / 10, 0);
function generateHeightMap(num) {
for (let i = 0; i < num; i++) {
let n = i == 0 ? num : arr[i - 1][0];
for (let j = 0; j < num; j++) {
let m = i == 0 ? num : arr[i - 1][j];
} else if (random() < 0.35) {
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]);