let colorSwatches = ["#FFFFFF", "#000000", "#fcaf32", "#27aae1", "#8dc63f"];
let selectedColor = colorSwatches[0];
mainCanvas = createCanvas(500, 500);
for (let i = 0; i < 25; i++) {
function mouseClicked() {
if (mouseY < 500 && mouseY >= 0 && mouseX >= 0 && mouseX < 500) {
let i = floor(mouseX / 100);
let j = floor(mouseY / 100);
colors[index] = selectedColor;
stroked[index] = selectedStroked;
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
strokeWeight(strokeWidth);
rect(x, y, 100 - strokeWidth, 100 - strokeWidth);
if (key === 's' || key === 'S') {
saveCanvas(mainCanvas, 'WallIcon', 'png');
function createSwatches() {
let swatchesContainer = createDiv();
swatchesContainer.style('display', 'flex');
swatchesContainer.style('flex-wrap', 'wrap');
swatchesContainer.style('margin-top', '20px');
swatchesContainer.style('margin-right', '20px');
for (let i = 0; i < colorSwatches.length; i++) {
let swatch = createDiv();
swatch.style('width', '50px');
swatch.style('height', '25px');
swatch.style('background-color', colorSwatches[i]);
swatch.style('margin-right', '10px');
swatch.style('margin-bottom', '10px');
swatch.mouseClicked(() => {
selectedColor = colorSwatches[i];
swatchesContainer.child(swatch);
for (let i = 0; i < colorSwatches.length; i++) {
let swatch = createDiv();
swatch.style('width', '40px');
swatch.style('height', '15px');
swatch.style('border', `5px solid ${colorSwatches[i]}`);
swatch.style('margin-right', '10px');
swatch.style('margin-bottom', '10px');
swatch.mouseClicked(() => {
selectedColor = colorSwatches[i];
swatchesContainer.child(swatch);
let selectedStroked = false;