1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef STYLECOLOR_H |
6 | #define STYLECOLOR_H |
7 | |
8 | #include "common/common.h" |
9 | |
10 | //from https://www.w3school.com.cn/cssref/css_colors.asp |
11 | namespace StyleColor |
12 | { |
13 | enum_def(Table, QColor) |
14 | { |
15 | enum_exp AliceBlue = QRgb(0xF0F8FF); |
16 | enum_exp AntiqueWhite = QRgb(0xFAEBD7); |
17 | enum_exp Aqua = QRgb(0x00FFFF); |
18 | enum_exp Aquamarine = QRgb(0x7FFFD4); |
19 | enum_exp Azure = QRgb(0xF0FFFF); |
20 | enum_exp Beige = QRgb(0xF5F5DC); |
21 | enum_exp Bisque = QRgb(0xFFE4C4); |
22 | enum_exp Black = QRgb(0x000000); |
23 | enum_exp BlanchedAlmond = QRgb(0xFFEBCD); |
24 | enum_exp Blue = QRgb(0x0000FF); |
25 | enum_exp BlueViolet = QRgb(0x8A2BE2); |
26 | enum_exp Brown = QRgb(0xA52A2A); |
27 | enum_exp BurlyWood = QRgb(0xDEB887); |
28 | enum_exp CadetBlue = QRgb(0x5F9EA0); |
29 | enum_exp Chartreuse = QRgb(0x7FFF00); |
30 | enum_exp Chocolate = QRgb(0xD2691E); |
31 | enum_exp Coral = QRgb(0xFF7F50); |
32 | enum_exp CornflowerBlue = QRgb(0x6495ED); |
33 | enum_exp Cornsilk = QRgb(0xFFF8DC); |
34 | enum_exp Crimson = QRgb(0xDC143C); |
35 | enum_exp Cyan = QRgb(0x00FFFF); |
36 | enum_exp DarkBlue = QRgb(0x00008B); |
37 | enum_exp DarkCyan = QRgb(0x008B8B); |
38 | enum_exp DarkGoldenRod = QRgb(0xB8860B); |
39 | enum_exp DarkGray = QRgb(0xA9A9A9); |
40 | enum_exp DarkGreen = QRgb(0x006400); |
41 | enum_exp DarkKhaki = QRgb(0xBDB76B); |
42 | enum_exp DarkMagenta = QRgb(0x8B008B); |
43 | enum_exp DarkOliveGreen = QRgb(0x556B2F); |
44 | enum_exp Darkorange = QRgb(0xFF8C00); |
45 | enum_exp DarkOrchid = QRgb(0x9932CC); |
46 | enum_exp DarkRed = QRgb(0x8B0000); |
47 | enum_exp DarkSalmon = QRgb(0xE9967A); |
48 | enum_exp DarkSeaGreen = QRgb(0x8FBC8F); |
49 | enum_exp DarkSlateBlue = QRgb(0x483D8B); |
50 | enum_exp DarkSlateGray = QRgb(0x2F4F4F); |
51 | enum_exp DarkTurquoise = QRgb(0x00CED1); |
52 | enum_exp DarkViolet = QRgb(0x9400D3); |
53 | enum_exp DeepPink = QRgb(0xFF1493); |
54 | enum_exp DeepSkyBlue = QRgb(0x00BFFF); |
55 | enum_exp DimGray = QRgb(0x696969); |
56 | enum_exp DodgerBlue = QRgb(0x1E90FF); |
57 | enum_exp Feldspar = QRgb(0xD19275); |
58 | enum_exp FireBrick = QRgb(0xB22222); |
59 | enum_exp FloralWhite = QRgb(0xFFFAF0); |
60 | enum_exp ForestGreen = QRgb(0x228B22); |
61 | enum_exp Fuchsia = QRgb(0xFF00FF); |
62 | enum_exp Gainsboro = QRgb(0xDCDCDC); |
63 | enum_exp GhostWhite = QRgb(0xF8F8FF); |
64 | enum_exp Gold = QRgb(0xFFD700); |
65 | enum_exp GoldenRod = QRgb(0xDAA520); |
66 | enum_exp Gray = QRgb(0x808080); |
67 | enum_exp Green = QRgb(0x008000); |
68 | enum_exp GreenYellow = QRgb(0xADFF2F); |
69 | enum_exp HoneyDew = QRgb(0xF0FFF0); |
70 | enum_exp HotPink = QRgb(0xFF69B4); |
71 | enum_exp IndianRed = QRgb(0xCD5C5C); |
72 | enum_exp Indigo = QRgb(0x4B0082); |
73 | enum_exp Ivory = QRgb(0xFFFFF0); |
74 | enum_exp Khaki = QRgb(0xF0E68C); |
75 | enum_exp Lavender = QRgb(0xE6E6FA); |
76 | enum_exp LavenderBlush = QRgb(0xFFF0F5); |
77 | enum_exp LawnGreen = QRgb(0x7CFC00); |
78 | enum_exp LemonChiffon = QRgb(0xFFFACD); |
79 | enum_exp LightBlue = QRgb(0xADD8E6); |
80 | enum_exp LightCoral = QRgb(0xF08080); |
81 | enum_exp LightCyan = QRgb(0xE0FFFF); |
82 | enum_exp LightGoldenRodYellow = QRgb(0xFAFAD2); |
83 | enum_exp LightGrey = QRgb(0xD3D3D3); |
84 | enum_exp LightGreen = QRgb(0x90EE90); |
85 | enum_exp LightPink = QRgb(0xFFB6C1); |
86 | enum_exp LightSalmon = QRgb(0xFFA07A); |
87 | enum_exp LightSeaGreen = QRgb(0x20B2AA); |
88 | enum_exp LightSkyBlue = QRgb(0x87CEFA); |
89 | enum_exp LightSlateBlue = QRgb(0x8470FF); |
90 | enum_exp LightSlateGray = QRgb(0x778899); |
91 | enum_exp LightSteelBlue = QRgb(0xB0C4DE); |
92 | enum_exp LightYellow = QRgb(0xFFFFE0); |
93 | enum_exp Lime = QRgb(0x00FF00); |
94 | enum_exp LimeGreen = QRgb(0x32CD32); |
95 | enum_exp Linen = QRgb(0xFAF0E6); |
96 | enum_exp Magenta = QRgb(0xFF00FF); |
97 | enum_exp Maroon = QRgb(0x800000); |
98 | enum_exp MediumAquaMarine = QRgb(0x66CDAA); |
99 | enum_exp MediumBlue = QRgb(0x0000CD); |
100 | enum_exp MediumOrchid = QRgb(0xBA55D3); |
101 | enum_exp MediumPurple = QRgb(0x9370D8); |
102 | enum_exp MediumSeaGreen = QRgb(0x3CB371); |
103 | enum_exp MediumSlateBlue = QRgb(0x7B68EE); |
104 | enum_exp MediumSpringGreen = QRgb(0x00FA9A); |
105 | enum_exp MediumTurquoise = QRgb(0x48D1CC); |
106 | enum_exp MediumVioletRed = QRgb(0xC71585); |
107 | enum_exp MidnightBlue = QRgb(0x191970); |
108 | enum_exp MintCream = QRgb(0xF5FFFA); |
109 | enum_exp MistyRose = QRgb(0xFFE4E1); |
110 | enum_exp Moccasin = QRgb(0xFFE4B5); |
111 | enum_exp NavajoWhite = QRgb(0xFFDEAD); |
112 | enum_exp Navy = QRgb(0x000080); |
113 | enum_exp OldLace = QRgb(0xFDF5E6); |
114 | enum_exp Olive = QRgb(0x808000); |
115 | enum_exp OliveDrab = QRgb(0x6B8E23); |
116 | enum_exp Orange = QRgb(0xFFA500); |
117 | enum_exp OrangeRed = QRgb(0xFF4500); |
118 | enum_exp Orchid = QRgb(0xDA70D6); |
119 | enum_exp PaleGoldenRod = QRgb(0xEEE8AA); |
120 | enum_exp PaleGreen = QRgb(0x98FB98); |
121 | enum_exp PaleTurquoise = QRgb(0xAFEEEE); |
122 | enum_exp PaleVioletRed = QRgb(0xD87093); |
123 | enum_exp PapayaWhip = QRgb(0xFFEFD5); |
124 | enum_exp PeachPuff = QRgb(0xFFDAB9); |
125 | enum_exp Peru = QRgb(0xCD853F); |
126 | enum_exp Pink = QRgb(0xFFC0CB); |
127 | enum_exp Plum = QRgb(0xDDA0DD); |
128 | enum_exp PowderBlue = QRgb(0xB0E0E6); |
129 | enum_exp Purple = QRgb(0x800080); |
130 | enum_exp Red = QRgb(0xFF0000); |
131 | enum_exp RosyBrown = QRgb(0xBC8F8F); |
132 | enum_exp RoyalBlue = QRgb(0x4169E1); |
133 | enum_exp SaddleBrown = QRgb(0x8B4513); |
134 | enum_exp Salmon = QRgb(0xFA8072); |
135 | enum_exp SandyBrown = QRgb(0xF4A460); |
136 | enum_exp SeaGreen = QRgb(0x2E8B57); |
137 | enum_exp SeaShell = QRgb(0xFFF5EE); |
138 | enum_exp Sienna = QRgb(0xA0522D); |
139 | enum_exp Silver = QRgb(0xC0C0C0); |
140 | enum_exp SkyBlue = QRgb(0x87CEEB); |
141 | enum_exp SlateBlue = QRgb(0x6A5ACD); |
142 | enum_exp SlateGray = QRgb(0x708090); |
143 | enum_exp Snow = QRgb(0xFFFAFA); |
144 | enum_exp SpringGreen = QRgb(0x00FF7F); |
145 | enum_exp SteelBlue = QRgb(0x4682B4); |
146 | enum_exp Tan = QRgb(0xD2B48C); |
147 | enum_exp Teal = QRgb(0x008080); |
148 | enum_exp Thistle = QRgb(0xD8BFD8); |
149 | enum_exp Tomato = QRgb(0xFF6347); |
150 | enum_exp Turquoise = QRgb(0x40E0D0); |
151 | enum_exp Violet = QRgb(0xEE82EE); |
152 | enum_exp VioletRed = QRgb(0xD02090); |
153 | enum_exp Wheat = QRgb(0xF5DEB3); |
154 | enum_exp White = QRgb(0xFFFFFF); |
155 | enum_exp WhiteSmoke = QRgb(0xF5F5F5); |
156 | enum_exp Yellow = QRgb(0xFFFF00); |
157 | enum_exp YellowGreen = QRgb(0x9ACD32); |
158 | }; |
159 | |
160 | inline int color(const QColor &col) |
161 | { |
162 | return (col.blue() << 16) | (col.green() << 8) | col.red(); |
163 | } |
164 | |
165 | inline int colorAlpha(const QColor &col) |
166 | { |
167 | return (col.alpha() << 24) | (col.blue() << 16) | (col.green() << 8) | col.red(); |
168 | } |
169 | |
170 | inline int colorAlpha(const QColor &col, const char alpha) { |
171 | return (col.alpha() << 24) | (col.blue() << 16) | (col.green() << 8) | col.red(); |
172 | } |
173 | }; |
174 | |
175 | # endif // STYLECOLOR_H |
176 |