Hummingbird Framework
 All Classes Functions Variables Modules Pages
Color.h
1 #ifndef HB_COLOR_h
2 #define HB_COLOR_h
3 
4 namespace hb
5 {
6  struct Color {
7  float r;
8  float g;
9  float b;
10  float a;
11 
15  Color() {
16  this->r = 0.0f;
17  this->g = 0.0f;
18  this->b = 0.0f;
19  this->a = 1.0f;
20  }
21 
29  Color(float r, float g, float b, float a = 1.0f) {
30  this->r = r;
31  this->g = g;
32  this->b = b;
33  this->a = a;
34  }
35 
45  Color(int r, int g, int b, int a = 255) {
46  this->r = (float)r/255.0f;
47  this->g = (float)g/255.0f;
48  this->b = (float)b/255.0f;
49  this->a = (float)a/255.0f;
50  }
51  };
52 }
53 
54 #endif
55 
float g
Green component of the color.
Definition: Color.h:8
float a
Alpha component of the color (its opacity)
Definition: Color.h:10
Definition: Box2DPlugin.h:6
Color(float r, float g, float b, float a=1.0f)
Floats contructor.
Definition: Color.h:29
float r
Red component of the color.
Definition: Color.h:7
A color represented in the RGBA format.
Definition: Color.h:6
Color(int r, int g, int b, int a=255)
Int contructor.
Definition: Color.h:45
Color()
Default constructor. Initializes to color black.
Definition: Color.h:15
float b
Blue component of the color.
Definition: Color.h:9