1#ifndef LXGUI_GUI_COLOR_HPP
2#define LXGUI_GUI_COLOR_HPP
4#include "lxgui/lxgui.hpp"
27 r(nr),
g(ng),
b(nb),
a(na) {}
28 explicit color(
const std::string& s);
30 hls
to_hls() const noexcept;
31 hsv
to_hsv() const noexcept;
33 bool operator==(const
color& c) const noexcept;
34 bool operator!=(const
color& c) const noexcept;
36 void operator+=(const
color& c) noexcept;
37 void operator-=(const
color& c) noexcept;
38 void operator*=(const
color& c) noexcept;
39 void operator*=(
float f) noexcept;
51 static constexpr
color
53 return color(
r / 255.0f,
g / 255.0f,
b / 255.0f,
a / 255.0f);
60color
operator+(
const color& c1,
const color& c2)
noexcept;
61color
operator-(
const color& c1,
const color& c2)
noexcept;
62color
operator*(
const color& c1,
const color& c2)
noexcept;
63color
operator*(
const color& c1,
float f)
noexcept;
64color
operator*(
float f,
const color& c2)
noexcept;
66std::ostream&
operator<<(std::ostream& stream,
const color& c);
67std::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)