feat: init palettes with default colorscheme to avoid messed up UI

This commit is contained in:
2025-12-17 09:50:14 +03:00
parent 5bb8a687ea
commit e6bac8e220
7 changed files with 114 additions and 64 deletions

View File

@@ -5,6 +5,7 @@
#include <unordered_map>
#include <core/palette/color.hpp>
#include <core/palette/color_keys.hpp>
namespace clrsync::core
{
@@ -37,8 +38,15 @@ class palette
{
return it->second;
}
static color default_color{};
return default_color;
auto default_it = DEFAULT_COLORS.find(key);
if (default_it != DEFAULT_COLORS.end())
{
static color default_color;
default_color.set(default_it->second);
return default_color;
}
static color empty_color{};
return empty_color;
}
const std::unordered_map<std::string, color> &colors() const