From 0abf33dc577dbfcedd610ace27762fa3446e6010 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 17 May 2024 16:56:11 -0400 Subject: [PATCH] feat: add emoji for each flavor (#81) --- mod.ts | 5 +++++ palette.json | 4 ++++ scripts/gen_palette.ts | 13 +++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mod.ts b/mod.ts index 2533740..2df9dc9 100644 --- a/mod.ts +++ b/mod.ts @@ -68,6 +68,11 @@ export type CatppuccinFlavor = Readonly<{ */ name: string; + /** + * Emoji associated with the flavor. Requires Unicode 13.0 (2020) or later to render + */ + emoji: string; + /** * Order of the flavor in the palette spec */ diff --git a/palette.json b/palette.json index cdc546d..8b5ca96 100644 --- a/palette.json +++ b/palette.json @@ -1,6 +1,7 @@ { "latte": { "name": "Latte", + "emoji": "🌻", "order": 0, "dark": false, "colors": { @@ -424,6 +425,7 @@ }, "frappe": { "name": "Frappé", + "emoji": "🪴", "order": 1, "dark": true, "colors": { @@ -847,6 +849,7 @@ }, "macchiato": { "name": "Macchiato", + "emoji": "🌺", "order": 2, "dark": true, "colors": { @@ -1270,6 +1273,7 @@ }, "mocha": { "name": "Mocha", + "emoji": "🌿", "order": 3, "dark": true, "colors": { diff --git a/scripts/gen_palette.ts b/scripts/gen_palette.ts index e1bf54e..7e3fffc 100644 --- a/scripts/gen_palette.ts +++ b/scripts/gen_palette.ts @@ -1,10 +1,10 @@ import { join } from "std/path/join.ts"; import tinycolor from "tinycolor2"; -import { - type CatppuccinColors, - type CatppuccinFlavor, - type Flavors, +import type { + CatppuccinColors, + CatppuccinFlavor, + Flavors, } from "@catppuccin/palette"; type Entries = { @@ -48,6 +48,7 @@ const prettyNames = [ const definitions = { latte: { name: "Latte", + emoji: "🌻", dark: false, colors: { rosewater: "#dc8a78", @@ -80,6 +81,7 @@ const definitions = { }, frappe: { name: "Frappé", + emoji: "🪴", dark: true, colors: { rosewater: "#f2d5cf", @@ -112,6 +114,7 @@ const definitions = { }, macchiato: { name: "Macchiato", + emoji: "🌺", dark: true, colors: { rosewater: "#f4dbd6", @@ -144,6 +147,7 @@ const definitions = { }, mocha: { name: "Mocha", + emoji: "🌿", dark: true, colors: { rosewater: "#f5e0dc", @@ -197,6 +201,7 @@ const formatted = entriesFromObject(definitions) .reduce((acc, [flavorName, flavor], currentIndex) => { acc[flavorName] = { name: flavor.name, + emoji: flavor.emoji, order: currentIndex, dark: flavor.dark, colors: entriesFromObject(flavor.colors).reduce(