Class Color#
Defined in File Color.h
Class Documentation#
-
class Color#
RGB color representation.
Color class represents a color by RGB and alpha value.
- Authors
beyss, stratmann
- Date
27.07.2017
Public Functions
-
inline Color(double r = 0, double g = 0, double b = 0, double a = 1)#
Creates a Color from RGB and Alpha values.
- Parameters:
r – the red value
g – the green value
b – the blue value
a – the alpha value
-
inline const double &r() const#
Access function for the color’s red value.
- Returns:
a reference to the colors red value
-
inline const double &g() const#
Access function for the color’s green value.
- Returns:
a reference to the colors green value
-
inline const double &b() const#
Access function for the color’s blue value.
- Returns:
a reference to the colors blue value
-
inline const double &a() const#
Access function for the color’s alpha value.
- Returns:
a reference to the colors alpha value
-
inline bool operator==(const Color &color) const#
Checks whether or not two colors are equal. This is the case if RGBA values are the same.
- Parameters:
color – the other color
- Returns:
equal or not
-
inline bool operator!=(const Color &color) const#
Checks whether or not two colors are not equal. Two colors would be equal if their RGBA values were the same.
- Parameters:
color – the other color
- Returns:
not equal or equal
-
inline void set_red(double red)#
Sets the red value of this Color. Input values from 0 to 255 will be automatically corrected to values from [0,1].
- Parameters:
red – the red value to set
-
inline void set_green(double green)#
Sets the green value of this Color. Input values from 0 to 255 will be automatically corrected to values from [0,1].
- Parameters:
green – the green value to set
Public Static Attributes