From 9a75d946f8839d9405413855d5494f2f2426886e Mon Sep 17 00:00:00 2001 From: Vyn Date: Mon, 4 Nov 2024 10:47:51 +0100 Subject: [PATCH] Add Green, Orange and Red colors --- cpp/include/selenite/palette.h | 3 +++ cpp/src/palette.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/include/selenite/palette.h b/cpp/include/selenite/palette.h index db5d6f7..eabf912 100644 --- a/cpp/include/selenite/palette.h +++ b/cpp/include/selenite/palette.h @@ -20,6 +20,9 @@ struct Palette { Color pane; Color foreground; Color foregroundHint; + Color green; + Color orange; + Color red; }; std::optional parseJson(const std::string &path); diff --git a/cpp/src/palette.cpp b/cpp/src/palette.cpp index 1cc5dae..5104a4b 100644 --- a/cpp/src/palette.cpp +++ b/cpp/src/palette.cpp @@ -30,7 +30,8 @@ std::optional parseJson(const std::string &path) !json["background"].is_string() || !json["background2"].is_string() || !json["background4"].is_string() || !json["background3"].is_string() || !json["pane"].is_string() || !json["foreground"].is_string() || - !json["foregroundHint"].is_string()) { + !json["foregroundHint"].is_string() || !json["green"].is_string() || + !json["orange"].is_string() || !json["red"].is_string()) { return std::nullopt; } @@ -44,6 +45,9 @@ std::optional parseJson(const std::string &path) .pane = hexStringToColor(json["pane"].get()), .foreground = hexStringToColor(json["foreground"].get()), .foregroundHint = hexStringToColor(json["foregroundHint"].get()), + .green = hexStringToColor(json["green"].get()), + .orange = hexStringToColor(json["orange"].get()), + .red = hexStringToColor(json["red"].get()), }; return palette; }