7 #ifndef NAZARA_COLOR_HPP 8 #define NAZARA_COLOR_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/String.hpp> 12 #include <Nazara/Math/Vector3.hpp> 16 struct SerializationContext;
22 inline Color(UInt8 red, UInt8 green, UInt8 blue, UInt8 alpha = 255);
23 inline explicit Color(UInt8 lightness);
24 inline Color(UInt8 color[3], UInt8 alpha = 255);
26 inline ~
Color() =
default;
41 static inline Color FromCMY(
float cyan,
float magenta,
float yellow);
42 static inline Color FromCMYK(
float cyan,
float magenta,
float yellow,
float black);
43 static inline Color FromHSL(UInt8 hue, UInt8 saturation, UInt8 lightness);
44 static inline Color FromHSV(
float hue,
float saturation,
float value);
47 static inline void ToCMY(
const Color& color,
float* cyan,
float* magenta,
float* yellow);
48 static inline void ToCMYK(
const Color& color,
float* cyan,
float* magenta,
float* yellow,
float* black);
49 static inline void ToHSL(
const Color& color, UInt8* hue, UInt8* saturation, UInt8* lightness);
50 static inline void ToHSV(
const Color& color,
float* hue,
float* saturation,
float* value);
52 static inline void ToXYZ(
const Color& color,
float* x,
float* y,
float* z);
56 static NAZARA_CORE_API
const Color Black;
57 static NAZARA_CORE_API
const Color Blue;
58 static NAZARA_CORE_API
const Color Cyan;
59 static NAZARA_CORE_API
const Color Green;
60 static NAZARA_CORE_API
const Color Magenta;
61 static NAZARA_CORE_API
const Color Orange;
62 static NAZARA_CORE_API
const Color Red;
63 static NAZARA_CORE_API
const Color Yellow;
64 static NAZARA_CORE_API
const Color White;
67 static float Hue2RGB(
float v1,
float v2,
float vH);
74 std::ostream& operator<<(std::ostream& out,
const Nz::Color& color);
76 #include <Nazara/Core/Color.inl> 78 #endif // NAZARA_COLOR_HPP Core class that represents a color.
Definition: Color.hpp:18
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
static void ToXYZ(const Color &color, Vector3f *vec)
Converts RGB representation to XYZ.
Definition: Color.inl:547
Color operator+=(const Color &angles)
Adds the color to this.
Definition: Color.inl:144
bool Unserialize(SerializationContext &context, bool *value)
Unserializes a boolean.
Definition: Algorithm.inl:279
bool operator!=(const Color &angles) const
Checks whether the two colors are equal.
Definition: Color.inl:180
static Color FromHSV(float hue, float saturation, float value)
Converts HSV representation to RGB.
Definition: Color.inl:266
Core class that represents a string.
Definition: String.hpp:22
Color operator+(const Color &angles) const
Adds two colors together.
Definition: Color.inl:106
bool IsOpaque() const
Return true is the color has no degree of transparency.
Definition: Color.inl:76
static void ToCMYK(const Color &color, float *cyan, float *magenta, float *yellow, float *black)
Converts RGB representation to CMYK.
Definition: Color.inl:402
static void ToHSV(const Color &color, float *hue, float *saturation, float *value)
Converts RGB representation to HSV.
Definition: Color.inl:494
String ToString() const
Converts this to string.
Definition: Color.inl:86
Color operator*=(const Color &angles)
Multiplies the color to this.
Definition: Color.inl:156
Color operator*(const Color &angles) const
Multiplies two colors together.
Definition: Color.inl:125
Structure containing a serialization/unserialization context states.
Definition: SerializationContext.hpp:18
Color()
Constructs a Color object by default.
Definition: Color.inl:22
static Color FromHSL(UInt8 hue, UInt8 saturation, UInt8 lightness)
Converts HSL representation to RGB.
Definition: Color.inl:227
static Color FromXYZ(const Vector3f &vec)
Converts XYZ representation to RGB.
Definition: Color.inl:335
bool Serialize(SerializationContext &context, bool value)
Serializes a boolean.
Definition: Algorithm.inl:214
bool operator==(const Color &angles) const
Checks whether the two colors are equal.
Definition: Color.inl:168
static void ToCMY(const Color &color, float *cyan, float *magenta, float *yellow)
Converts RGB representation to CMYK.
Definition: Color.inl:386
static Color FromCMYK(float cyan, float magenta, float yellow, float black)
Converts CMYK representation to RGB.
Definition: Color.inl:211
static void ToHSL(const Color &color, UInt8 *hue, UInt8 *saturation, UInt8 *lightness)
Converts RGB representation to HSL.
Definition: Color.inl:435
static Color FromCMY(float cyan, float magenta, float yellow)
Converts CMY representation to RGB.
Definition: Color.inl:196