16#ifndef AEONGUI_COLOR_H
17#define AEONGUI_COLOR_H
27 enum CSS3Color : uint32_t
29 aliceblue = 0xfff0f8ff,
30 antiquewhite = 0xfffaebd7,
32 aquamarine = 0xff7fffd4,
37 blanchedalmond = 0xffffebcd,
39 blueviolet = 0xff8a2be2,
41 burlywood = 0xffdeb887,
42 cadetblue = 0xff5f9ea0,
43 chartreuse = 0xff7fff00,
44 chocolate = 0xffd2691e,
46 cornflowerblue = 0xff6495ed,
47 cornsilk = 0xfffff8dc,
50 darkblue = 0xff00008b,
51 darkcyan = 0xff008b8b,
52 darkgoldenrod = 0xffb8860b,
53 darkgray = 0xffa9a9a9,
54 darkgreen = 0xff006400,
55 darkgrey = 0xffa9a9a9,
56 darkkhaki = 0xffbdb76b,
57 darkmagenta = 0xff8b008b,
58 darkolivegreen = 0xff556b2f,
59 darkorange = 0xffff8c00,
60 darkorchid = 0xff9932cc,
62 darksalmon = 0xffe9967a,
63 darkseagreen = 0xff8fbc8f,
64 darkslateblue = 0xff483d8b,
65 darkslategray = 0xff2f4f4f,
66 darkslategrey = 0xff2f4f4f,
67 darkturquoise = 0xff00ced1,
68 darkviolet = 0xff9400d3,
69 deeppink = 0xffff1493,
70 deepskyblue = 0xff00bfff,
73 dodgerblue = 0xff1e90ff,
74 firebrick = 0xffb22222,
75 floralwhite = 0xfffffaf0,
76 forestgreen = 0xff228b22,
78 gainsboro = 0xffdcdcdc,
79 ghostwhite = 0xfff8f8ff,
81 goldenrod = 0xffdaa520,
85 greenyellow = 0xffadff2f,
86 honeydew = 0xfff0fff0,
88 indianred = 0xffcd5c5c,
92 lavender = 0xffe6e6fa,
93 lavenderblush = 0xfffff0f5,
94 lawngreen = 0xff7cfc00,
95 lemonchiffon = 0xfffffacd,
96 lightblue = 0xffadd8e6,
97 lightcoral = 0xfff08080,
98 lightcyan = 0xffe0ffff,
99 lightgoldenrodyellow = 0xfffafad2,
100 lightgray = 0xffd3d3d3,
101 lightgreen = 0xff90ee90,
102 lightgrey = 0xffd3d3d3,
103 lightpink = 0xffffb6c1,
104 lightsalmon = 0xffffa07a,
105 lightseagreen = 0xff20b2aa,
106 lightskyblue = 0xff87cefa,
107 lightslategray = 0xff778899,
108 lightslategrey = 0xff778899,
109 lightsteelblue = 0xffb0c4de,
110 lightyellow = 0xffffffe0,
112 limegreen = 0xff32cd32,
114 magenta = 0xffff00ff,
116 mediumaquamarine = 0xff66cdaa,
117 mediumblue = 0xff0000cd,
118 mediumorchid = 0xffba55d3,
119 mediumpurple = 0xff9370db,
120 mediumseagreen = 0xff3cb371,
121 mediumslateblue = 0xff7b68ee,
122 mediumspringgreen = 0xff00fa9a,
123 mediumturquoise = 0xff48d1cc,
124 mediumvioletred = 0xffc71585,
125 midnightblue = 0xff191970,
126 mintcream = 0xfff5fffa,
127 mistyrose = 0xffffe4e1,
128 moccasin = 0xffffe4b5,
129 navajowhite = 0xffffdead,
131 oldlace = 0xfffdf5e6,
133 olivedrab = 0xff6b8e23,
135 orangered = 0xffff4500,
137 palegoldenrod = 0xffeee8aa,
138 palegreen = 0xff98fb98,
139 paleturquoise = 0xffafeeee,
140 palevioletred = 0xffdb7093,
141 papayawhip = 0xffffefd5,
142 peachpuff = 0xffffdab9,
146 powderblue = 0xffb0e0e6,
149 rosybrown = 0xffbc8f8f,
150 royalblue = 0xff4169e1,
151 saddlebrown = 0xff8b4513,
153 sandybrown = 0xfff4a460,
154 seagreen = 0xff2e8b57,
155 seashell = 0xfffff5ee,
158 skyblue = 0xff87ceeb,
159 slateblue = 0xff6a5acd,
160 slategray = 0xff708090,
161 slategrey = 0xff708090,
163 springgreen = 0xff00ff7f,
164 steelblue = 0xff4682b4,
167 thistle = 0xffd8bfd8,
169 transparent = 0x00000000,
170 turquoise = 0xff40e0d0,
174 whitesmoke = 0xfff5f5f5,
176 yellowgreen = 0xff9acd32
191 DLL
static bool IsColor (
const std::string& value, uint32_t* color_value =
nullptr );
198 DLL
explicit Color ( uint32_t value );
203 DLL Color (
const std::string& value );
210 DLL Color ( uint8_t
A, uint8_t
R, uint8_t
G, uint8_t
B );
216 DLL
void Blend ( Color src );
221 DLL
double R()
const;
225 DLL
double G()
const;
229 DLL
double B()
const;
233 DLL
double A()
const;
255 using none = std::monostate;
276 using ColorAttr = std::variant<none, Color, LinearGradient>;
A single color stop in a gradient.
Definition Color.hpp:259
Color color
Stop color.
Definition Color.hpp:261
double offset
Position along the gradient [0.0, 1.0].
Definition Color.hpp:260
A linear gradient paint.
Definition Color.hpp:266
bool objectBoundingBox
True if coords are relative to the element bounding box.
Definition Color.hpp:272
double x2
End X of the gradient vector.
Definition Color.hpp:269
double y2
End Y of the gradient vector.
Definition Color.hpp:270
double y1
Start Y of the gradient vector.
Definition Color.hpp:268
std::vector< GradientStop > stops
Color stops.
Definition Color.hpp:271
double x1
Start X of the gradient vector.
Definition Color.hpp:267
Pixel Color Union. The Color union allows access to each unsigned 8 bit RGBA color component individu...
Definition Color.hpp:185
std::string ToString() const
Convert the color to a CSS-style string representation.
Definition Color.cpp:282
uint32_t bgra
32 bit Unsigned integer color value.
Definition Color.hpp:238
double G() const
Get green component as a double in [0.0, 1.0].
Definition Color.cpp:243
double B() const
Get blue component as a double in [0.0, 1.0].
Definition Color.cpp:247
double A() const
Get alpha component as a double in [0.0, 1.0].
Definition Color.cpp:251
void Blend(Color src)
Blends the color with the incoming source color. To better handle transparency the blend function use...
Definition Color.cpp:256
double R() const
Get red component as a double in [0.0, 1.0].
Definition Color.cpp:239
uint8_t a
Alpha color element.
Definition Color.hpp:250
uint8_t r
Red color element.
Definition Color.hpp:249
static bool IsColor(const std::string &value, uint32_t *color_value=nullptr)
Check whether a string represents a valid CSS color.
Definition Color.cpp:186
uint8_t g
Green color element.
Definition Color.hpp:248
uint8_t b
Blue color element.
Definition Color.hpp:247
static const std::regex ColorRegex
Regex used to parse CSS color strings.
Definition Color.hpp:193