Implement image handling
[claws.git] / src / plugins / litehtml_viewer / litehtml / web_color.h
1 #pragma once\r
2 \r
3 namespace litehtml\r
4 {\r
5         struct def_color\r
6         {\r
7                 const tchar_t*  name;\r
8                 const tchar_t*  rgb;\r
9         };\r
10 \r
11         extern def_color g_def_colors[];\r
12 \r
13         struct web_color\r
14         {\r
15                 byte    blue;\r
16                 byte    green;\r
17                 byte    red;\r
18                 byte    alpha;\r
19 \r
20                 web_color(byte r, byte g, byte b, byte a = 255)\r
21                 {\r
22                         blue    = b;\r
23                         green   = g;\r
24                         red             = r;\r
25                         alpha   = a;\r
26                 }\r
27 \r
28                 web_color()\r
29                 {\r
30                         blue    = 0;\r
31                         green   = 0;\r
32                         red             = 0;\r
33                         alpha   = 0xFF;\r
34                 }\r
35 \r
36                 web_color(const web_color& val)\r
37                 {\r
38                         blue    = val.blue;\r
39                         green   = val.green;\r
40                         red             = val.red;\r
41                         alpha   = val.alpha;\r
42                 }\r
43 \r
44                 web_color& operator=(const web_color& val)\r
45                 {\r
46                         blue    = val.blue;\r
47                         green   = val.green;\r
48                         red             = val.red;\r
49                         alpha   = val.alpha;\r
50                         return *this;\r
51                 }\r
52                 static web_color                from_string(const tchar_t* str);\r
53                 static const tchar_t*   resolve_name(const tchar_t* name);\r
54                 static bool                             is_color(const tchar_t* str);\r
55         };\r
56 }