/*
 * Mirai. Copyright (C) 2024 Vyn
 * This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
 * The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
 */

#include "SeleniteSetup.h"
#include "selenite/palette.h"

slint::Color seleniteColorToSlint(const selenite::Color &color)
{
	return slint::Color::from_rgb_uint8(color.r, color.g, color.b);
}

void setSelenitePalette(const ui::Palette &uiPalette, const selenite::Palette &palette)
{
	uiPalette.set_accent(seleniteColorToSlint(palette.primary));
	uiPalette.set_background(seleniteColorToSlint(palette.background));
	uiPalette.set_pane(seleniteColorToSlint(palette.pane));
	uiPalette.set_foreground(seleniteColorToSlint(palette.foreground));
	uiPalette.set_foreground_hint(seleniteColorToSlint(palette.foregroundHint));
	uiPalette.set_control_background(seleniteColorToSlint(palette.background3));
	uiPalette.set_control_foreground(seleniteColorToSlint(palette.foreground));
	uiPalette.set_card_background(seleniteColorToSlint(palette.background2));
	uiPalette.set_green(seleniteColorToSlint(palette.green));
	uiPalette.set_orange(seleniteColorToSlint(palette.orange));
	uiPalette.set_red(seleniteColorToSlint(palette.red));
}
