From 6b45adaee0cbb4f2c7067f2d5080af5c455625cd Mon Sep 17 00:00:00 2001 From: winston Date: Wed, 13 Dec 2023 19:20:54 +0100 Subject: [PATCH] feat(whiskers): add colors object in context --- whiskers/src/template.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/whiskers/src/template.rs b/whiskers/src/template.rs index 51ea54f1..28de0bda 100644 --- a/whiskers/src/template.rs +++ b/whiskers/src/template.rs @@ -193,11 +193,13 @@ pub fn make_context(flavor: catppuccin::Flavour) -> serde_json::Value { .collect(); let mut context = - serde_json::to_value(color_map).expect("color names & hexcodes can be serialized"); + serde_json::to_value(color_map.clone()).expect("color names & hexcodes can be serialized"); context["flavor"] = flavor.name().into(); context["isLight"] = (flavor == catppuccin::Flavour::Latte).into(); context["isDark"] = (flavor != catppuccin::Flavour::Latte).into(); + context["colors"] = + serde_json::to_value(color_map).expect("color names & hexcodes can be serialized"); context }