Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8419 in orxonox.OLD for branches/gui/src/lib/util


Ignore:
Timestamp:
Jun 14, 2006, 11:07:48 PM (18 years ago)
Author:
bensch
Message:

Better coloring sceme

Location:
branches/gui/src/lib/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/util/color.cc

    r8376 r8419  
    1818#include "color.h"
    1919#include <stdio.h>
     20
     21
     22void Color::debug() const
     23{
     24  printf("r:%0.2f g:%0.2f, b:%0.2f, a:%0.2f\n", r(), g(), b(), a());
     25}
    2026
    2127/**
  • branches/gui/src/lib/util/color.h

    r8378 r8419  
    1919  Color(const Color& c) { _rgba[0] = c.r(); _rgba[1] = c.g(); _rgba[2] = c.b(); _rgba[3] = c.a(); }
    2020
     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
    2124  inline float& operator[](unsigned int i) { return _rgba[i]; }
    2225  inline const float& operator[](unsigned int i) const { return _rgba[i]; }
     
    3134  inline float& a() { return _rgba[3]; }
    3235
     36
     37
    3338  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; };
    3439
     40  void debug() const;
    3541
    3642  /// STATIC TRANSFORMATIONS
Note: See TracChangeset for help on using the changeset viewer.