let gradient_layers = [];
colorMode(HSB, 360, 100, 100, 100);
palette = random(wes_palettes).colors.concat();
for (let i = 0; i < palette.length; i++) {
palette[i] = color(palette[i]);
for (let j = 1; j < palette.length; j++) {
let gradient_layer = createGraphics(random([2,3,4,5,6]), 1);
gradient_layer.colorMode(HSB, 360, 100, 100, 100);
let gradient = gradient_layer.drawingContext.createLinearGradient(
let c1 = color(palette[i]);
let c2 = color(palette[j]);
gradient.addColorStop(0, c1);
gradient.addColorStop(1, c2);
gradient_layer.drawingContext.fillStyle = gradient;
gradient_layer.noStroke();
gradient_layer.rect(0, 0, gradient_layer.width, gradient_layer.height);
gradient_layers.push(gradient_layer);
let d = width - offset * 2;
translate(width / 2, height / 2);
rotate((int(random(4)) * 360) / 4);
translate(-d / 2, -d / 2);
drawSeparateRect(0, 0, d, d, minD);
background(random(palette));
function drawSeparateRect(ox, oy, w, h, minD) {
if (yStep + y > yMax) yStep = yMax - y;
if (xStep + x > xMax) xStep = xMax - x;
xArr.push([x, y, w, yStep]);
yArr.push(shuffle(xArr, true));
let bool = random() > 0.15;
drawSeparateRect(x, y, w, h, minD);
translate(x + w / 2, y + h / 2);
let angle = (int(random(4)) * 360) / 4;
scale(random() > 0.5 ? -1 : 1, random() > 0.5 ? -1 : 1);
drawingContext.shadowColor = color(0, 0, 0, 33);
drawingContext.shadowBlur = width / 30;
image(random(gradient_layers), 0, 0, h, w);
image(random(gradient_layers), 0, 0, w, h);
colors: ["#FAD510", "#CB2314", "#273046", "#354823", "#1E1E1E"],
colors: ["#E1BD6D", "#EABE94", "#0B775E", "#35274A", "#F2300F"],
colors: ["#E1BD6D", "#EABE94", "#0B775E", "#35274A", "#F2300F"],
{ name: "Royal1", colors: ["#899DA4", "#C93312", "#FAEFD1", "#DC863B"] },
colors: ["#9A8822", "#F5CDB4", "#F8AFA8", "#FDDDA0", "#74A089"],
colors: ["#3B9AB2", "#78B7C5", "#EBCC2A", "#E1AF00", "#F21A00"],
colors: ["#FF0000", "#00A08A", "#F2AD00", "#F98400", "#5BBCD6"],
colors: ["#ECCBAE", "#046C9A", "#D69C4E", "#ABDDDE", "#000000"],
{ name: "Chevalier1", colors: ["#446455", "#FDD262", "#D3DDDC", "#C7B19C"] },
colors: ["#DD8D29", "#E2D200", "#46ACC8", "#E58601", "#B40F20"],
{ name: "Moonrise1", colors: ["#F3DF6C", "#CEAB07", "#D5D5D3", "#24281A"] },
{ name: "Moonrise2", colors: ["#798E87", "#C27D38", "#CCC591", "#29211F"] },
colors: ["#85D4E3", "#F4B5BD", "#9C964A", "#CDC08C", "#FAD77B"],
colors: ["#D8B70A", "#02401B", "#A2A475", "#81A88D", "#972D15"],
colors: ["#F1BB7B", "#FD6467", "#5B1A18", "#D67236"],
colors: ["#E6A0C4", "#C6CDF7", "#D8A499", "#7294D4"],
colors: ["#9986A5", "#79402E", "#CCBA72", "#0F0D0E", "#D9D0D3", "#8D8680"],
colors: ["#EAD3BF", "#AA9486", "#B6854D", "#39312F", "#1C1718"],
colors: ["#90D4CC", "#BD3027", "#B0AFA2", "#7FC0C6", "#9D9C85"],