diff --git a/whiskers/README.md b/whiskers/README.md index e6c4fd0..0221bae 100644 --- a/whiskers/README.md +++ b/whiskers/README.md @@ -124,6 +124,8 @@ These types are designed to closely match the [palette.json](https://github.com/ | - | - | - | - | | `name` | `String` | The name of the flavor. | `"Latte"`, `"Frappé"`, `"Macchiato"`, `"Mocha"` | | `identifier` | `String` | The identifier of the flavor. | `"latte"`, `"frappe"`, `"macchiato"`, `"mocha"` | +| `emoji` | `char` | Emoji associated with the flavor. | `'🌻'`, `'🪴'`, `'🌺'`, `'🌿'` | +| `order` | `u32` | Order of the flavor in the palette spec. | `0` to `3` | | `dark` | `bool` | Whether the flavor is dark. | `false` for Latte, `true` for others | | `light` | `bool` | Whether the flavor is light. | `true` for Latte, `false` for others | | `colors` | `Map` | A map of color identifiers to their respective values. | | @@ -134,6 +136,7 @@ These types are designed to closely match the [palette.json](https://github.com/ | - | - | - | - | | `name` | `String` | The name of the color. | `"Rosewater"`, `"Surface 0"`, `"Base"` | | `identifier` | `String` | The identifier of the color. | `"rosewater"`, `"surface0"`, `"base"` | +| `order` | `u32` | Order of the color in the palette spec. | `0` to `25` | | `accent` | `bool` | Whether the color is an accent color. | | | `hex` | `String` | The color in hexadecimal format. | `"1e1e2e"` | | `rgb` | `RGB` | The color in RGB format. | | diff --git a/whiskers/src/models.rs b/whiskers/src/models.rs index 6779ae0..b084de1 100644 --- a/whiskers/src/models.rs +++ b/whiskers/src/models.rs @@ -14,6 +14,8 @@ pub struct Palette { pub struct Flavor { pub name: String, pub identifier: String, + pub emoji: char, + pub order: u32, pub dark: bool, pub light: bool, pub colors: IndexMap, @@ -23,6 +25,7 @@ pub struct Flavor { pub struct Color { pub name: String, pub identifier: String, + pub order: u32, pub accent: bool, pub hex: String, pub rgb: RGB, @@ -82,6 +85,7 @@ fn color_from_hex( Ok(Color { name: blueprint.name.to_string(), identifier: blueprint.name.identifier().to_string(), + order: blueprint.order, accent: blueprint.accent, hex, rgb, @@ -103,6 +107,7 @@ fn color_from_catppuccin( Color { name: color.name.to_string(), identifier: color.name.identifier().to_string(), + order: color.order, accent: color.accent, hex, rgb: RGB { @@ -167,6 +172,8 @@ pub fn build_palette( Flavor { name: flavor.name.to_string(), identifier: flavor.name.identifier().to_string(), + emoji: flavor.emoji, + order: flavor.order, dark: flavor.dark, light: !flavor.dark, colors, @@ -233,6 +240,7 @@ impl Color { Self { name: blueprint.name.clone(), identifier: blueprint.identifier.clone(), + order: blueprint.order, accent: blueprint.accent, hex: rgb_to_hex(&rgb, opacity), rgb, @@ -257,6 +265,7 @@ impl Color { Self { name: blueprint.name.clone(), identifier: blueprint.identifier.clone(), + order: blueprint.order, accent: blueprint.accent, hex: rgb_to_hex(&rgb, opacity), rgb,