Changeset 8419 in orxonox.OLD for branches/gui/src/lib/util
- Timestamp:
- Jun 14, 2006, 11:07:48 PM (18 years ago)
- Location:
- branches/gui/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/util/color.cc
r8376 r8419 18 18 #include "color.h" 19 19 #include <stdio.h> 20 21 22 void Color::debug() const 23 { 24 printf("r:%0.2f g:%0.2f, b:%0.2f, a:%0.2f\n", r(), g(), b(), a()); 25 } 20 26 21 27 /** -
branches/gui/src/lib/util/color.h
r8378 r8419 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 const Color& operator=(const Color& c) { _rgba[0] = c.r(); _rgba[1] = c.g(); _rgba[2] = c.b(); _rgba[3] = c.a(); return *this; }; 22 bool operator==(const Color& c) const { return (r() == c.r() && g() == c.g() && b() == c.b() && a() == c.a()); }; 23 21 24 inline float& operator[](unsigned int i) { return _rgba[i]; } 22 25 inline const float& operator[](unsigned int i) const { return _rgba[i]; } … … 31 34 inline float& a() { return _rgba[3]; } 32 35 36 37 33 38 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; }; 34 39 40 void debug() const; 35 41 36 42 /// STATIC TRANSFORMATIONS
Note: See TracChangeset
for help on using the changeset viewer.