diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-20 13:39:44 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-20 13:39:44 +0100 |
commit | c6d7623cc0bc17aa171bc5078f2f36c15be28683 (patch) | |
tree | 29a377248db09c59b2c290eec9ea5d701a989592 /src/crepe/api/Color.h | |
parent | 9836b2225d11b629349e7abd6afcc1e4d41aa4f9 (diff) |
implemented feedback from @lonkaars
Diffstat (limited to 'src/crepe/api/Color.h')
-rw-r--r-- | src/crepe/api/Color.h | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/src/crepe/api/Color.h b/src/crepe/api/Color.h index c207ba7..84edb5c 100644 --- a/src/crepe/api/Color.h +++ b/src/crepe/api/Color.h @@ -4,41 +4,20 @@ namespace crepe { -// TODO: make Color a struct w/o constructors/destructors -class Color { - - // FIXME: can't these colors be defined as a `static constexpr const Color` - // instead? - -public: - Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); - static const Color & get_white(); - static const Color & get_red(); - static const Color & get_green(); - static const Color & get_blue(); - static const Color & get_cyan(); - static const Color & get_magenta(); - static const Color & get_yellow(); - static const Color & get_black(); - -public: - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; - -private: - static Color white; - static Color red; - static Color green; - static Color blue; - static Color cyan; - static Color magenta; - static Color yellow; - static Color black; - -private: - friend class SDLContext; +struct Color { + uint8_t r = 0x00; + uint8_t g = 0x00; + uint8_t b = 0x00; + uint8_t a = 0xff; + + static const Color WHITE; + static const Color RED; + static const Color GREEN; + static const Color BLUE; + static const Color CYAN; + static const Color MAGENTA; + static const Color YELLOW; + static const Color BLACK; }; } // namespace crepe |