17 #ifndef DGL_COLOR_HPP_INCLUDED
18 #define DGL_COLOR_HPP_INCLUDED
39 struct {
float red, green, blue, alpha; };
51 Color(
int red,
int green,
int blue,
int alpha = 255) noexcept;
57 Color(
float red,
float green,
float blue,
float alpha = 1.0f) noexcept;
74 static Color fromHSL(
float hue,
float saturation,
float lightness,
float alpha = 1.0f);
90 bool isEqual(
const Color& color,
bool withAlpha =
true) noexcept;
91 bool isNotEqual(
const Color& color,
bool withAlpha =
true) noexcept;
92 bool operator==(
const Color& color) noexcept;
93 bool operator!=(
const Color& color) noexcept;
104 Color(
const NVGcolor&) noexcept;
105 operator NVGcolor()
const noexcept;
112 #endif // DGL_COLOR_HPP_INCLUDED
void fixBounds() noexcept
static Color fromHSL(float hue, float saturation, float lightness, float alpha=1.0f)
bool isEqual(const Color &color, bool withAlpha=true) noexcept
void interpolate(const Color &other, float u) noexcept
static Color fromHTML(const char *rgb, float alpha=1.0f)