1 #ifndef LXGUI_GUI_COLOR_HPP
2 #define LXGUI_GUI_COLOR_HPP
4 #include "lxgui/lxgui.hpp"
26 r(nr),
g(ng),
b(nb),
a(na) {}
27 explicit color(
const std::string& s);
29 hls
to_hls() const noexcept;
30 hsv
to_hsv() const noexcept;
32 bool operator==(const
color& c) const noexcept;
33 bool operator!=(const
color& c) const noexcept;
35 void operator+=(const
color& c) noexcept;
36 void operator-=(const
color& c) noexcept;
37 void operator*=(const
color& c) noexcept;
38 void operator*=(
float f) noexcept;
50 static constexpr
color
51 from_bytes(std::uint8_t
r, std::uint8_t
g, std::uint8_t
b, std::uint8_t
a = 255u) noexcept {
52 return color(
r / 255.0f,
g / 255.0f,
b / 255.0f,
a / 255.0f);
59 color
operator+(
const color& c1,
const color& c2) noexcept;
60 color
operator-(
const color& c1,
const color& c2) noexcept;
61 color
operator*(
const color& c1,
const color& c2) noexcept;
62 color
operator*(
const color& c1,
float f) noexcept;
63 color
operator*(
float f,
const color& c2) noexcept;
65 std::ostream&
operator<<(std::ostream& stream,
const color& c);
66 std::istream&
operator>>(std::istream& stream, color& c);
Holds a single color (float RGBA, 128 bits)
hsv to_hsv() const noexcept
static color from_hls(const hls &hls) noexcept
static color from_hsv(const hsv &hsv) noexcept
constexpr color()=default
constexpr color(channel nr, channel ng, channel nb, channel na=1.0f) noexcept
static constexpr color from_bytes(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a=255u) noexcept
hls to_hls() const noexcept
std::ostream & operator<<(std::ostream &stream, const color &c)
std::istream & operator>>(std::istream &stream, color &c)
color operator+(const color &c1, const color &c2) noexcept
color operator*(const color &c1, const color &c2) noexcept
color operator-(const color &c1, const color &c2) noexcept
Holds a single color (byte RGBA, 32 bits)