Skip to content

Commit

Permalink
feat: add emoji for each flavor (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter authored May 17, 2024
1 parent 408f081 commit 0abf33d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 4 additions & 0 deletions palette.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"latte": {
"name": "Latte",
"emoji": "🌻",
"order": 0,
"dark": false,
"colors": {
Expand Down Expand Up @@ -424,6 +425,7 @@
},
"frappe": {
"name": "Frappé",
"emoji": "🪴",
"order": 1,
"dark": true,
"colors": {
Expand Down Expand Up @@ -847,6 +849,7 @@
},
"macchiato": {
"name": "Macchiato",
"emoji": "🌺",
"order": 2,
"dark": true,
"colors": {
Expand Down Expand Up @@ -1270,6 +1273,7 @@
},
"mocha": {
"name": "Mocha",
"emoji": "🌿",
"order": 3,
"dark": true,
"colors": {
Expand Down
13 changes: 9 additions & 4 deletions scripts/gen_palette.ts
Original file line number Diff line number Diff line change
@@ -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<T> = {
Expand Down Expand Up @@ -48,6 +48,7 @@ const prettyNames = [
const definitions = {
latte: {
name: "Latte",
emoji: "🌻",
dark: false,
colors: {
rosewater: "#dc8a78",
Expand Down Expand Up @@ -80,6 +81,7 @@ const definitions = {
},
frappe: {
name: "Frappé",
emoji: "🪴",
dark: true,
colors: {
rosewater: "#f2d5cf",
Expand Down Expand Up @@ -112,6 +114,7 @@ const definitions = {
},
macchiato: {
name: "Macchiato",
emoji: "🌺",
dark: true,
colors: {
rosewater: "#f4dbd6",
Expand Down Expand Up @@ -144,6 +147,7 @@ const definitions = {
},
mocha: {
name: "Mocha",
emoji: "🌿",
dark: true,
colors: {
rosewater: "#f5e0dc",
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 0abf33d

Please sign in to comment.