/* ui/palette.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_UI_PALETTE_H__ #define __INCLUDED_UI_PALETTE_H__ #include "math/color.h" namespace ui { /** * @brief color palette used by the user interface * */ class Palette { public: /** * @brief color index * */ enum Color { Foreground = 0, Background = 1, Border = 2, Text = 3, Highlight = 4, Disabled = 5, Pointer = 6, Active = 7, Debug = 8, Mission = 9, Bold = 10, Fancy = 11, Warning = 12, Error = 13 }; /** * @brief default constructor, creates a default palette * */ Palette(); /** * @brief copy construcotr * */ Palette(const Palette & other); /** * @brief default destructor * */ ~Palette(); /* ---- mutators ------------------------------------------- */ /// set foreground color inline void set_foreground(const math::Color &color) { palette_foreground.assign(color); } /// set background color inline void set_background(const math::Color &color) { palette_background.assign(color); } /// set border color inline void set_border(const math::Color &color) { palette_border.assign(color); } /// set text color inline void set_text(const math::Color &color) { palette_text.assign(color); } /// set highlight color inline void set_highlight(const math::Color &color) { palette_highlight.assign(color); } /// set disabled color inline void set_disabled(const math::Color &color) { palette_disabled.assign(color); } /// set pointer color inline void set_pointer(const math::Color &color) { palette_pointer.assign(color); } /// set active pointer color inline void set_active(const math::Color &color) { palette_active.assign(color); } /// set debug color inline void set_debug(const math::Color &color) { palette_debug.assign(color); } /// set mission color inline void set_mission(const math::Color &color) { palette_mission.assign(color); } /// set bold text color inline void set_bold(const math::Color &color) { palette_bold.assign(color); } /// set fancy text color inline void set_fancy(const math::Color &color) { palette_fancy.assign(color); } /// set warning text color inline void set_warning(const math::Color &color) { palette_warning.assign(color); } /// set error text color inline void set_error(const math::Color &color) { palette_error.assign(color); } /* ---- inspectors ----------------------------------------- */ /// foreground color inline const math::Color &foreground() const { return palette_foreground; } /// background color inline const math::Color &background() const { return palette_background; } /// border color inline const math::Color &border() const { return palette_border; } /// text color inline const math::Color &text() const { return palette_text; } /// highlight color inline const math::Color &highlight() const { return palette_highlight; } /// disabled color inline const math::Color &disabled() const { return palette_disabled; } /// pointer color inline const math::Color &pointer() const { return palette_pointer; } /// active pointer color inline const math::Color &active() const { return palette_active; } /// debug color inline const math::Color &debug() const { return palette_debug; } /// mission color inline const math::Color &mission() const { return palette_mission; } /// bold text color inline const math::Color &bold() const { return palette_bold; } /// fancy text color inline const math::Color &fancy() const { return palette_fancy; } /// warning text color inline const math::Color &warning() const { return palette_warning; } /// error text color inline const math::Color &error() const { return palette_error; } // indexed color const math::Color &color(Palette::Color palettecolor) const; private: // UI colors math::Color palette_foreground; math::Color palette_background; math::Color palette_border; math::Color palette_text; math::Color palette_highlight; math::Color palette_disabled; math::Color palette_pointer; math::Color palette_active; math::Color palette_debug; // HUD colors math::Color palette_mission; // additional text colors math::Color palette_bold; math::Color palette_fancy; math::Color palette_warning; math::Color palette_error; }; } #endif // __INCLUDED_UI_PALETTE_H__