selenite/cpp/include/selenite/selenite.h

24 lines
1.2 KiB
C++

#pragma once
#include "palette.h"
template <typename SlintColor, typename SeleniteColor>
SlintColor seleniteColorToSlint(const SeleniteColor &color)
{
return SlintColor::from_rgb_uint8(color.r, color.g, color.b);
}
template <typename SlintColor, typename SeleniteColor, typename UiPalette>
void setSelenitePalette(const UiPalette &uiPalette, const selenite::Palette &palette)
{
uiPalette.set_accent(seleniteColorToSlint<SlintColor>(palette.primary));
uiPalette.set_background(seleniteColorToSlint<SlintColor>(palette.background));
uiPalette.set_pane(seleniteColorToSlint<SlintColor>(palette.pane));
uiPalette.set_foreground(seleniteColorToSlint<SlintColor>(palette.foreground));
uiPalette.set_foreground_hint(seleniteColorToSlint<SlintColor>(palette.foregroundHint));
uiPalette.set_control_background(seleniteColorToSlint<SlintColor>(palette.background3));
uiPalette.set_control_foreground(seleniteColorToSlint<SlintColor>(palette.foreground));
uiPalette.set_card_background(seleniteColorToSlint<SlintColor>(palette.background2));
uiPalette.set_green(seleniteColorToSlint<SlintColor>(palette.green));
uiPalette.set_orange(seleniteColorToSlint<SlintColor>(palette.orange));
uiPalette.set_red(seleniteColorToSlint<SlintColor>(palette.red));
}