Changeset 8378 in orxonox.OLD for branches/gui/src/lib/util
- Timestamp:
- Jun 14, 2006, 12:31:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/util/color.h
r8376 r8378 16 16 { 17 17 public: 18 Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 0.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; };18 Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; }; 19 19 Color(const Color& c) { _rgba[0] = c.r(); _rgba[1] = c.g(); _rgba[2] = c.b(); _rgba[3] = c.a(); } 20 20 21 float& operator[](unsigned int i) { return _rgba[i]; }22 const float& operator[](unsigned int i) const { return _rgba[i]; }21 inline float& operator[](unsigned int i) { return _rgba[i]; } 22 inline const float& operator[](unsigned int i) const { return _rgba[i]; } 23 23 24 float r() const { return _rgba[0]; } 25 float& r() { return _rgba[0]; } 26 float g() const { return _rgba[1]; } 27 float& g() { return _rgba[1]; } 28 float b() const { return _rgba[2]; } 29 float& b() { return _rgba[2]; } 30 float a() const { return _rgba[3]; } 31 float& a() { return _rgba[3]; } 24 inline float r() const { return _rgba[0]; } 25 inline float& r() { return _rgba[0]; } 26 inline float g() const { return _rgba[1]; } 27 inline float& g() { return _rgba[1]; } 28 inline float b() const { return _rgba[2]; } 29 inline float& b() { return _rgba[2]; } 30 inline float a() const { return _rgba[3]; } 31 inline float& a() { return _rgba[3]; } 32 33 void setColor(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; }; 32 34 33 35
Note: See TracChangeset
for help on using the changeset viewer.