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 kAlphaFull;
28  static const Color kAlphaHalf;
29  static const Color kAlphaNone;
30  static const Color kWhite;
31  static const Color kBlack;
32  static const Color kRed;
33  static const Color kGreen;
34  static const Color kBlue;
35 
39  Color(void) noexcept;
40 
45  explicit Color(const tbCore::uint32& colorARGB) noexcept;
46 
58  explicit Color(const float clampedAlpha, const float clampedRed, const float clampedGreen, const float clampedBlue) noexcept;
59 
64  void SetColor(const tbCore::uint32& colorARGB);
65 
77  void SetColor(const float clampedAlpha, const float clampedRed, const float clampedGreen, const float clampedBlue);
78 
89  void SetColor(const float clampedTween, const Color& startColor, const Color& finalColor);
90 
94  tbCore::uint32 GetColorARGB(void) const;
95 
99  tbCore::uint32 GetColorABGR(void) const;
100 
104  tbCore::uint8 GetAlphaByte(void) const;
105 
109  tbCore::uint8 GetRedByte(void) const;
110 
114  tbCore::uint8 GetGreenByte(void) const;
115 
119  tbCore::uint8 GetBlueByte(void) const;
120 
124  float GetAlpha(void) const;
125 
129  float GetRed(void) const;
130 
134  float GetGreen(void) const;
135 
139  float GetBlue(void) const;
140 
141  private:
142  //The floats may disappear for size reasons and use GetChannelAsFloat()
143  float mAlpha;
144  float mRed;
145  float mGreen;
146  float mBlue;
147 
148  tbCore::uint32 mARGB;
149  };
150 
151  }; /* namespace Graphics */
152 }; /* namespace TurtleBrains */
153 
154 namespace tbGraphics = TurtleBrains::Graphics;
155 
156 #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:34
static const Color kAlphaNone
Definition: tb_color.h:29
static const Color kBlack
Definition: tb_color.h:31
static const Color kRed
Definition: tb_color.h:32
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:30
void SetColor(const tbCore::uint32 &colorARGB)
static const Color kGreen
Definition: tb_color.h:33
static const Color kAlphaFull
Definition: tb_color.h:27
float GetAlpha(void) const
tbCore::uint8 GetAlphaByte(void) const
tbCore::uint8 GetRedByte(void) const
float GetRed(void) const
float GetBlue(void) const
static const Color kAlphaHalf
Definition: tb_color.h:28
float GetGreen(void) const
Contains core functionality for each component of the API.
Definition: tb_debug_logger.h:91