diff --git a/procreate/Catppuccin Frappe.swatches b/procreate/Catppuccin Frappe.swatches new file mode 100644 index 0000000..ba9e130 Binary files /dev/null and b/procreate/Catppuccin Frappe.swatches differ diff --git a/procreate/Catppuccin Latte.swatches b/procreate/Catppuccin Latte.swatches new file mode 100644 index 0000000..8b5bcc5 Binary files /dev/null and b/procreate/Catppuccin Latte.swatches differ diff --git a/procreate/Catppuccin Macchiato.swatches b/procreate/Catppuccin Macchiato.swatches new file mode 100644 index 0000000..f5ab68e Binary files /dev/null and b/procreate/Catppuccin Macchiato.swatches differ diff --git a/procreate/Catppuccin Mocha.swatches b/procreate/Catppuccin Mocha.swatches new file mode 100644 index 0000000..049e096 Binary files /dev/null and b/procreate/Catppuccin Mocha.swatches differ diff --git a/procreate/build.ts b/procreate/build.ts new file mode 100755 index 0000000..f273d61 --- /dev/null +++ b/procreate/build.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env deno run --allow-read --allow-write --allow-env +import { createSwatchesFile } from "npm:procreate-swatches"; + +const capitalize = (str: string) => str[0].toUpperCase() + str.slice(1); + +type Color = { + hex: string; + rgb: string; + hsl: string; +}; +type Palette = Record; + +const library: Palette[] = JSON.parse( + await Deno.readTextFile("../palette.json") +); + +for (const palette in library) { + const colours: Palette = library[palette]; + + const rgbValues = Object.values(colours).map((colour) => [ + colour.rgb.match(/\d+/g), + "rgb", + ]); + + const name = `Catppuccin ${capitalize(palette)}`; + const data: ArrayBuffer = await createSwatchesFile(name, rgbValues); + + Deno.writeFileSync(`./${name}.swatches`, new Uint8Array(data)); +}