31 constexpr
Color(
unsigned char R,
unsigned char G,
unsigned char B,
unsigned char A=255) :
r(R),
g(G),
b(B),
alpha(A) {}
33 constexpr
Color(
unsigned int hex) :
34 r((hex&0xff000000)>>24),
35 g((hex&0x00ff0000)>>16),
36 b((hex&0x0000ff00)>>8),
37 alpha((hex&0x000000ff)>>0) {}
43 SDL_Color
SDL()
const;
44 operator SDL_Color()
const;
57 return "{r: " + std::to_string(r) +
", g:" + std::to_string(g) +
", b:" + std::to_string(b) +
"}";
63 constexpr HSL(
double hue,
double saturation,
double lightness,
unsigned char a = 255) : h(hue), s(saturation), l(lightness), alpha(a) {}
64 constexpr HSL(
unsigned int hex) :
65 h(((double)((hex&0xff000000)>>24)/255)),
66 s(((double)((hex&0x00ff0000)>>16)/255)),
67 l(((double)((hex&0x0000ff00)>> 8)/255)),
68 alpha(((double)((hex&0x000000ff) ) )) {}
72 explicit operator Color()
const;
74 explicit operator HSL()
const;
89 inline operator Color()
const {
return color; }
90 inline operator std::string()
const {
return formula; }
ColorString(const char *s)
Definition: Color.hpp:87
Color ZeroAlpha() const
Definition: Color.hpp:47
unsigned char r
Definition: Color.hpp:40
ColorString(const Color &c)
Definition: Color.hpp:88
std::string ToString()
Definition: Color.hpp:56
ColorString & operator=(const ColorString &other)
Definition: Color.hpp:91
ColorString(const std::string &s)
Definition: Color.hpp:86
ColorString(const ColorString &other)
Definition: Color.hpp:85
unsigned char g
Definition: Color.hpp:40
Color Darker(double amount) const
constexpr Color(unsigned char R, unsigned char G, unsigned char B, unsigned char A=255)
Definition: Color.hpp:31
unsigned char alpha
Definition: Color.hpp:40
Definition: Alertable.hpp:26
constexpr Color(unsigned int hex)
Definition: Color.hpp:33
unsigned char b
Definition: Color.hpp:40
Color SetAlpha(float a_) const
Definition: Color.hpp:49
Color Lighter(double amount) const
Color()
Definition: Color.hpp:38