Add Green, Orange and Red colors

This commit is contained in:
Vyn 2024-11-04 10:47:51 +01:00
parent 00857b287f
commit 9a75d946f8
2 changed files with 8 additions and 1 deletions

View file

@ -20,6 +20,9 @@ struct Palette {
Color pane; Color pane;
Color foreground; Color foreground;
Color foregroundHint; Color foregroundHint;
Color green;
Color orange;
Color red;
}; };
std::optional<Palette> parseJson(const std::string &path); std::optional<Palette> parseJson(const std::string &path);

View file

@ -30,7 +30,8 @@ std::optional<Palette> parseJson(const std::string &path)
!json["background"].is_string() || !json["background2"].is_string() || !json["background"].is_string() || !json["background2"].is_string() ||
!json["background4"].is_string() || !json["background3"].is_string() || !json["background4"].is_string() || !json["background3"].is_string() ||
!json["pane"].is_string() || !json["foreground"].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; return std::nullopt;
} }
@ -44,6 +45,9 @@ std::optional<Palette> parseJson(const std::string &path)
.pane = hexStringToColor(json["pane"].get<std::string>()), .pane = hexStringToColor(json["pane"].get<std::string>()),
.foreground = hexStringToColor(json["foreground"].get<std::string>()), .foreground = hexStringToColor(json["foreground"].get<std::string>()),
.foregroundHint = hexStringToColor(json["foregroundHint"].get<std::string>()), .foregroundHint = hexStringToColor(json["foregroundHint"].get<std::string>()),
.green = hexStringToColor(json["green"].get<std::string>()),
.orange = hexStringToColor(json["orange"].get<std::string>()),
.red = hexStringToColor(json["red"].get<std::string>()),
}; };
return palette; return palette;
} }