ThemeManager.cpp 3.37 KiB
#include "ThemeManager.h"
ThemeManager& ThemeManager::Instance() {
    static ThemeManager instance;
    return instance;
sf::Color ThemeManager::getButtonFillColor() const {
    return m_currentColors.button_fill;
void ThemeManager::set_theme(ThemeManager::Theme newTheme) {
    m_theme = newTheme;
    loadThemeColors();
sf::Color ThemeManager::getButtonOutlineColor() const {
    return m_currentColors.button_frame;
sf::Color ThemeManager::getButtonTextColor() const {
    return m_currentColors.button_text;
sf::Color ThemeManager::getButtonSelectionColor() const {
    return m_currentColors.button_selection;
sf::Color ThemeManager::getTitleTextColor() const {
    return m_currentColors.title_text;
sf::Color ThemeManager::getGameBackgroundInGameColor() const {
    return m_currentColors.game_background_ingame;
sf::Color ThemeManager::getGameBackgroundWinColor() const {
    return m_currentColors.game_background_win;
sf::Color ThemeManager::getGameBackgroundLostColor() const {
    return m_currentColors.game_background_lost;
sf::Color ThemeManager::getRoomColor() const {
    return m_currentColors.room_color;
sf::Color ThemeManager::getWallColor() const {
    return m_currentColors.wall_color;
void ThemeManager::loadThemeColors() {
    if (m_theme == Theme::LIGHT) {
        m_currentColors = {
                sf::Color::White,         // button_text
                sf::Color(21, 117, 217), // button_fill
                sf::Color(0, 0, 0), // button_selection
                sf::Color::White,         // button_frame
                sf::Color(240, 240, 240), // select_level_background
                sf::Color(255, 255, 255), // game_background_ingame
                sf::Color(0, 255, 0),     // game_background_win
                sf::Color(255, 0, 0),     // game_background_lost
                sf::Color(255, 255, 0),   // game_pacman
                sf::Color(100, 100, 100), // game_pacman_invisible
                sf::Color(200, 200, 255), // game_room
                sf::Color(50, 50, 50),    // game_wall
                sf::Color(255, 165, 0),   // game_food
                sf::Color(255, 0, 0),     // game_enemy
                sf::Color::White,    // title_text
717273747576777879808182838485868788899091929394959697
sf::Color(255, 255, 255), // room_color sf::Color(0, 0, 0) // wall_color }; } else if (m_theme == Theme::DARK) { m_currentColors = { sf::Color::White, // button_text sf::Color(21, 117, 217), // button_fill sf::Color(80, 80, 80), // button_selection sf::Color::White, // button_frame sf::Color(30, 30, 30), // select_level_background sf::Color(40, 40, 40), // game_background_ingame sf::Color(0, 255, 0), // game_background_win sf::Color(255, 0, 0), // game_background_lost sf::Color(255, 255, 0), // game_pacman sf::Color(100, 100, 100), // game_pacman_invisible sf::Color(100, 100, 100), // game_room sf::Color(50, 50, 50), // game_wall sf::Color(255, 165, 0), // game_food sf::Color(255, 0, 0), // game_enemy sf::Color::White, // title_text sf::Color(0, 0, 0), // room_color sf::Color(0, 0, 255) // wall_color }; } }