00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_UTILS_COLOR_H
00012
#define OPENCAL_UTILS_COLOR_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
00017
00018
00019
00020
00021
00022
00023
00024
namespace OpenCAL
00025 {
00026
namespace Utils
00027 {
00031
00032 class OPENCAL_API Color
00033 {
00034
private:
00035
00036
float m_values[4];
00037
00038
public:
00039
00040
static Color white;
00041
static Color black;
00042
static Color red;
00043
static Color blue;
00044
static Color green;
00045
static Color yellow;
00046
00047
public:
00048
00049 Color(
float r = 0.0f,
float g = 0.0f,
float b = 0.0f,
float a = 1.0f);
00050 Color(
float *values);
00051 Color(
const Color &source);
00052
virtual ~Color();
00053
00054
00055
float *get() {
return m_values; }
00056
float getR()
const {
return m_values[0]; }
00057
float getG()
const {
return m_values[1]; }
00058
float getB()
const {
return m_values[2]; }
00059
float getA()
const {
return m_values[3]; }
00060
00061
00062
void set(
float r,
float g,
float b,
float a = 1.0f);
00063
void set(
float *values);
00064
void setR(
float r) { m_values[0] = r; }
00065
void setG(
float g) { m_values[1] = g; }
00066
void setB(
float b) { m_values[2] = b; }
00067
void setA(
float a) { m_values[3] = a; }
00068
00069
00070 Color operator/(
float factor)
const;
00071
00072
00073 operator const float *()
const {
return m_values; }
00074
00075
00076
00077
00078
00079
00080
00081 };
00082 }
00083 }
00084
00085
#endif // ifndef OPENCAL_UTILS_COLOR_H