TurtleBrains  0.2.1
High quality, portable, C++ API for native application and game development.
tb_color.h
1 
9 #ifndef _TurtleBrains_Color_h_
10 #define _TurtleBrains_Color_h_
11 
12 #include "../core/tb_types.h"
13 
14 namespace TurtleBrains
15 {
16  namespace Graphics
17  {
18 
23  class Color
24  {
25  public:
26  //TODO: TIM: Planning: More color definitions? Yellow, Purple, Light Gray, Dark Gray?
27  static const Color kWhite;
28  static const Color kBlack;
29  static const Color kRed;
30  static const Color kGreen;
31  static const Color kBlue;
32 
36  Color(void);
37 
42  explicit Color(const tbCore::uint32& colorARGB);
43 
55  Color(const float clampedAlpha, const float clampedRed, const float clampedGreen, const float clampedBlue);
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
static const Color kBlue
Definition: tb_color.h:31
static const Color kBlack
Definition: tb_color.h:28
static const Color kRed
Definition: tb_color.h:29
Contains all functions, classes and helpers related to game/application development written by Tim "B...
Definition: tb_application_dialog.h:21
tbCore::uint32 GetColorABGR(void) const
Definition: tb_color.h:23
static const Color kWhite
Definition: tb_color.h:27
void SetColor(const tbCore::uint32 &colorARGB)
static const Color kGreen
Definition: tb_color.h:30
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
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:27
float GetBlue(void) const
float GetGreen(void) const