style: reformat after editorconfig change
This commit is contained in:
parent
a04bd7869c
commit
ec883a880b
1 changed files with 12 additions and 12 deletions
|
@ -4,26 +4,26 @@ import { createSwatchesFile } from "npm:procreate-swatches";
|
||||||
const capitalize = (str: string) => str[0].toUpperCase() + str.slice(1);
|
const capitalize = (str: string) => str[0].toUpperCase() + str.slice(1);
|
||||||
|
|
||||||
type Color = {
|
type Color = {
|
||||||
hex: string;
|
hex: string;
|
||||||
rgb: string;
|
rgb: string;
|
||||||
hsl: string;
|
hsl: string;
|
||||||
};
|
};
|
||||||
type Palette = Record<string, Color>;
|
type Palette = Record<string, Color>;
|
||||||
|
|
||||||
const library: Palette[] = JSON.parse(
|
const library: Palette[] = JSON.parse(
|
||||||
await Deno.readTextFile("../palette.json")
|
await Deno.readTextFile("../palette.json"),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const palette in library) {
|
for (const palette in library) {
|
||||||
const colours: Palette = library[palette];
|
const colours: Palette = library[palette];
|
||||||
|
|
||||||
const rgbValues = Object.values(colours).map((colour) => [
|
const rgbValues = Object.values(colours).map((colour) => [
|
||||||
colour.rgb.match(/\d+/g),
|
colour.rgb.match(/\d+/g),
|
||||||
"rgb",
|
"rgb",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const name = `Catppuccin ${capitalize(palette)}`;
|
const name = `Catppuccin ${capitalize(palette)}`;
|
||||||
const data: ArrayBuffer = await createSwatchesFile(name, rgbValues);
|
const data: ArrayBuffer = await createSwatchesFile(name, rgbValues);
|
||||||
|
|
||||||
Deno.writeFileSync(`./${name}.swatches`, new Uint8Array(data));
|
Deno.writeFileSync(`./${name}.swatches`, new Uint8Array(data));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue