TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
tb_color.h
1 
9 #ifndef _TurtleBrains_Color_h_
10 #define _TurtleBrains_Color_h_
11 
12 #include "../core/tb_types.h"
13 #include "tb_color_palette.h"
14 
15 namespace TurtleBrains
16 {
17  namespace Graphics
18  {
23  class Color
24  {
25  public:
29  Color(void) noexcept;
30 
36  Color(const ColorPalette& colorFromPalette) noexcept;
37 
42  explicit Color(const tbCore::uint32& colorARGB) noexcept;
43 
55  explicit Color(const float clampedAlpha, const float clampedRed, const float clampedGreen, const float clampedBlue) noexcept;
56 
61  void SetColor(const tbCore::uint32& colorARGB);
62 
74  void SetColor(const float clampedAlpha, const float clampedRed, const float clampedGreen, const float clampedBlue);
75 
86  void SetColor(const float clampedTween, const Color& startColor, const Color& finalColor);
87 
91  tbCore::uint32 GetColorARGB(void) const;
92 
96  tbCore::uint32 GetColorABGR(void) const;
97 
101  tbCore::uint8 GetAlphaByte(void) const;
102 
106  tbCore::uint8 GetRedByte(void) const;
107 
111  tbCore::uint8 GetGreenByte(void) const;
112 
116  tbCore::uint8 GetBlueByte(void) const;
117 
121  float GetAlpha(void) const;
122 
126  float GetRed(void) const;
127 
131  float GetGreen(void) const;
132 
136  float GetBlue(void) const;
137 
138  private:
139  //The floats may disappear for size reasons and use GetChannelAsFloat()
140  float mAlpha;
141  float mRed;
142  float mGreen;
143  float mBlue;
144 
145  tbCore::uint32 mARGB;
146  };
147 
148  }; /* namespace Graphics */
149 }; /* namespace TurtleBrains */
150 
152 
153 #endif /* _TurtleBrains_Color_h_ */
tbCore::uint8 GetBlueByte(void) const
Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring th...
tbCore::uint8 GetGreenByte(void) const
tbCore::uint32 GetColorARGB(void) const
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
tbCore::uint32 GetColorABGR(void) const
Definition: tb_color.h:23
void SetColor(const tbCore::uint32 &colorARGB)
float GetAlpha(void) const
tbCore::uint8 GetAlphaByte(void) const
uint8_t uint8
Unsigned integer with a size of 8 bits. Supports values from 0 to 255.
Definition: tb_types.h:23
tbCore::uint8 GetRedByte(void) const
ColorPalette
Definition: tb_color_palette.h:21
float GetRed(void) const
uint32_t uint32
Unsigned integer with a size of 32 bits. Supports values from 0 to 4294967295, (2^32 - 1)...
Definition: tb_types.h:28
float GetBlue(void) const
float GetGreen(void) const