feat: add procreate swatches
This commit is contained in:
parent
3c2cdf21b4
commit
a04bd7869c
5 changed files with 29 additions and 0 deletions
BIN
procreate/Catppuccin Frappe.swatches
Normal file
BIN
procreate/Catppuccin Frappe.swatches
Normal file
Binary file not shown.
BIN
procreate/Catppuccin Latte.swatches
Normal file
BIN
procreate/Catppuccin Latte.swatches
Normal file
Binary file not shown.
BIN
procreate/Catppuccin Macchiato.swatches
Normal file
BIN
procreate/Catppuccin Macchiato.swatches
Normal file
Binary file not shown.
BIN
procreate/Catppuccin Mocha.swatches
Normal file
BIN
procreate/Catppuccin Mocha.swatches
Normal file
Binary file not shown.
29
procreate/build.ts
Executable file
29
procreate/build.ts
Executable file
|
@ -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<string, Color>;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
Loading…
Reference in a new issue