61 RGB(
const std::string& rgbString);
191 HSV(
double hue,
double saturation,
double brightness) { setHue(hue); setSaturation(saturation); setBrightness(brightness); }
195 void setHue(
double value) { _hue =
value;
if(_hue < 0) { _hue = 0; }
else { _hue = std::fmod(_hue, 360.0); } }
197 void setSaturation(
double value) { _saturation =
value;
if(_saturation < 0) { _saturation = 0; }
else if(_saturation > 1) { _saturation = 1; } }
199 void setBrightness(
double value) { _brightness =
value;
if(_brightness < 0) { _brightness = 0; }
else if(_brightness > 1) { _brightness = 1; } }
204 double _saturation = 0;
205 double _brightness = 0;
void setSaturation(double value)
Definition: Color.h:197
double getHue() const
Definition: Color.h:194
Class defining a point in 2D space with numbers of type double.
Definition: Math.h:45
RGB(uint8_t red, uint8_t green, uint8_t blue)
Definition: Color.h:69
void setRed(double value)
Converts a normalized intensity between 0 and 1 to an intensity between 0 and 255 and sets the intens...
Definition: Color.h:90
void setOpacity(double value)
Converts a normalized opacity between 0 and 1 to an opacity between 0 and 255 and sets it...
Definition: Color.h:80
NormalizedRGB(uint8_t red, uint8_t green, uint8_t blue)
Constructor taking intensities between 0 and 255 which are being converted to the normalized intensit...
Definition: Color.h:135
double getBrightness() const
Definition: Color.h:198
void setGreen(double value)
Converts a normalized intensity between 0 and 1 to an intensity between 0 and 255 and sets the intens...
Definition: Color.h:99
void setGreen(uint8_t value)
Converts an intensity between 0 and 255 to the normalized intensity between 0 and 1 and sets the inte...
Definition: Color.h:162
RGB(NormalizedRGB &rgb)
Constructor taking a normalized RGB class with color intensities between 0 and 1 which are being conv...
Definition: Color.h:68
double getRed() const
Definition: Color.h:146
double getSaturation() const
Definition: Color.h:196
void setHue(double value)
Definition: Color.h:195
void setOpacity(uint8_t value)
Definition: Color.h:81
Definition: BaseLib.cpp:34
virtual ~HSV()
Definition: Color.h:192
virtual ~Color()
Destructor.
Definition: Color.cpp:205
void setRed(uint8_t value)
Definition: Color.h:91
Class defining a triangle.
Definition: Math.h:156
uint8_t _red
Definition: Color.h:115
HSV()
Definition: Color.h:190
Class defining a 3x3 matrix.
Definition: Math.h:92
NormalizedRGB(RGB &rgb)
Constructor taking a not normalized RGB class with color intensities between 0 and 255 which are bein...
Definition: Color.h:142
std::string toString()
Definition: Color.cpp:112
virtual ~RGB()
Definition: Color.h:70
PVariable value
Definition: UiElements.h:217
Class defining a HSV color.
Definition: Color.h:187
Color()
Constructor.
Definition: Color.cpp:201
void setGreen(uint8_t value)
Definition: Color.h:100
void setBlue(double value)
Converts a normalized intensity between 0 and 1 to an intensity between 0 and 255 and sets the intens...
Definition: Color.h:108
double getBlue() const
Definition: Color.h:164
virtual ~NormalizedRGB()
Definition: Color.h:144
bool _opacityDefined
Definition: Color.h:113
static void cie1931XyToRgb(const Math::Point2D &xy, const double &brightness, const Math::Matrix3x3 &conversionMatrix, const double &gamma, NormalizedRGB &rgb)
Converts CIE 1931 color space chromaticity coordinates (x, y) to RGB as reference white...
Definition: Color.cpp:277
NormalizedRGB()
Definition: Color.h:126
void setGreen(double value)
Definition: Color.h:163
uint8_t _blue
Definition: Color.h:117
Class defining a RGB color with intensity values for each color between 0 and 1.
Definition: Color.h:123
void setBrightness(double value)
Definition: Color.h:199
uint8_t getBlue() const
Definition: Color.h:101
void setRed(double value)
Definition: Color.h:154
RGB()
Definition: Color.h:54
void setRed(uint8_t value)
Converts an intensity between 0 and 255 to the normalized intensity between 0 and 1 and sets the inte...
Definition: Color.h:153
uint8_t getGreen() const
Definition: Color.h:92
uint8_t getRed() const
Definition: Color.h:83
void setBlue(uint8_t value)
Converts an intensity between 0 and 255 to the normalized intensity between 0 and 1 and sets the inte...
Definition: Color.h:171
Class defining a RGB color with intensity values for each color between 0 and 255.
Definition: Color.h:51
void setBlue(uint8_t value)
Definition: Color.h:109
static void rgbToCie1931Xy(const NormalizedRGB &rgb, const Math::Matrix3x3 &conversionMatrix, const double &gamma, Math::Point2D &xy, double &brightness)
Converts a RGB value to it's CIE 1931 color space chromaticity coordinates (x, y).
Definition: Color.cpp:246
bool opacityDefined()
Definition: Color.h:72
NormalizedRGB(double red, double green, double blue)
Definition: Color.h:143
double getGreen() const
Definition: Color.h:155
uint8_t _green
Definition: Color.h:116
HSV(double hue, double saturation, double brightness)
Definition: Color.h:191
static void getConversionMatrix(const Math::Triangle &gamut, Math::Matrix3x3 &conversionMatrix, Math::Matrix3x3 &inversedConversionMatrix)
Gets the RGB to XYZ and XYZ to RGB conversion matrix for the specified chromaticity coordinates of an...
Definition: Color.cpp:209
uint8_t getOpacity() const
Definition: Color.h:73
uint8_t _opacity
Definition: Color.h:114
void setBlue(double value)
Definition: Color.h:172