Photon 1.0.0
Loading...
Searching...
No Matches
web_color.h
Go to the documentation of this file.
1#ifndef LH_WEB_COLOR_H
2#define LH_WEB_COLOR_H
3
4namespace litehtml
5{
6 class document_container;
7
8 struct web_color
9 {
10 byte red = 0;
11 byte green = 0;
12 byte blue = 0;
13 byte alpha = 255;
14 bool is_current_color = false;
15
16 static const web_color transparent;
17 static const web_color black;
18 static const web_color white;
20
22 web_color(byte r, byte g, byte b, byte a = 255) : red(r), green(g), blue(b), alpha(a) {}
24
25 bool operator==(web_color color) const { return red == color.red && green == color.green && blue == color.blue && alpha == color.alpha; }
26 bool operator!=(web_color color) const { return !(*this == color); }
27
28 web_color darken(double fraction) const;
29 string to_string() const;
30 };
31
32 bool parse_color(const css_token& token, web_color& color, document_container* container);
33}
34
35#endif // LH_WEB_COLOR_H
Definition background.h:12
bool parse_color(const css_token &token, web_color &color, document_container *container)
Definition web_color.cpp:412
Definition Bitmap.h:10
Definition web_color.h:9
static const web_color current_color
Definition web_color.h:19
bool operator!=(web_color color) const
Definition web_color.h:26
byte alpha
Definition web_color.h:13
web_color()
Definition web_color.h:21
string to_string() const
Definition web_color.cpp:432
web_color(bool is_current_color)
Definition web_color.h:23
static const web_color white
Definition web_color.h:18
byte green
Definition web_color.h:11
byte blue
Definition web_color.h:12
bool operator==(web_color color) const
Definition web_color.h:25
web_color darken(double fraction) const
Definition web_color.cpp:420
bool is_current_color
Definition web_color.h:14
static const web_color black
Definition web_color.h:17
web_color(byte r, byte g, byte b, byte a=255)
Definition web_color.h:22
byte red
Definition web_color.h:10
static const web_color transparent
Definition web_color.h:16
b
Definition tag_strings.h:61
a
Definition tag_strings.h:43