diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-20 14:52:52 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-20 14:52:52 +0100 |
commit | a01c2dc46daeffa0a5c92230d1513047a072c04d (patch) | |
tree | b0df9754cf9c8bd900594816f9bdac20679308c3 /src/crepe/api/Color.h | |
parent | 81664b46f5cb7c28d629ddafe4cbea7e717d62d2 (diff) | |
parent | f78e8011ee77ba5303a5e608cc81c3b303d35943 (diff) |
Merge branch 'master' into niels/RenderingParticle
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 aa47bf4..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(); - -private: - // TODO: why are these private!? - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; - - 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 |