emoji_arr = createEmojiArr();
colorMode(HSB, 360, 100, 100, 100);
let cells = int(random(1, 6));
let d = (width - offset * 2 - margin * (cells - 1)) / cells;
for (let j = 0; j < cells; j++) {
for (let i = 0; i < cells; i++) {
let x = offset + i * (d + margin);
let y = offset + j * (d + margin);
separateGrid(x, y, d, d);
function separateGrid(x, y, w, h) {
translate(x + w / 2, y + h / 2);
translate(-w / 2, -h / 2);
drawSeparateShape(0, 0, v, h);
drawSeparateShape(0, 0, v, h);
function drawSeparateShape(x, y, w, h) {
yStep = random(h / random(1.5, 4) - h / 10) + h / 10;
if (cy + yStep > h) yStep = h - cy;
xStep = random(w / random(1.5, 4) - w / 10) + w / 10;
if (cx + xStep > w) xStep = w - cx;
let sx = random(45) * (random() > 0.5 ? -1 : 1);
let sy = random(45) * (random() > 0.5 ? -1 : 1);
translate(cx + xStep / 2, cy + yStep / 2);
textSize(max(xStep, yStep));
textAlign(CENTER, CENTER);
let str = random(emoji_arr).emoji;
drawingContext.shadowColor = color(0, 0, 0, 16);
drawingContext.shadowBlur = w / 10;
function createEmojiArr() {
for (let i = 128512; i < 128592; i++) {
str = String.fromCodePoint(i);
if (obj.color[0] != 0 && obj.color[1] != 0 && obj.color[2] != 0) {
for (let i = 127744; i < 128318; i++) {
str = String.fromCodePoint(i);
if (obj.color[0] != 0 && obj.color[1] != 0 && obj.color[2] != 0) {
function arrSelect(arr, num) {
while (arr.length > num) {
let n = int(random(arr.length));
function createEmoji(str) {
let g = createGraphics(16, 16);
g.textAlign(CENTER, CENTER);
g.text(str, g.width / 2, g.height / 2);
let c = g.get(g.width / 2, g.height / 2);
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]);