1 | const _allColors = {};
|
2 | function registerColor(name, value) {
|
3 | if (Array.isArray(name)) {
|
4 | name.forEach((n) => (_allColors[n.toLowerCase()] = value));
|
5 | }
|
6 | else {
|
7 | _allColors[name.toLowerCase()] = value;
|
8 | }
|
9 | return value;
|
10 | }
|
11 | export function isKnownName(name) {
|
12 | if (!name) {
|
13 | return undefined;
|
14 | }
|
15 | return name.toLowerCase() in _allColors;
|
16 | }
|
17 | export function getKnownColor(name) {
|
18 | if (!name) {
|
19 | return undefined;
|
20 | }
|
21 | return _allColors[name.toLowerCase()];
|
22 | }
|
23 | export const Transparent = registerColor('Transparent', 0x00000000);
|
24 | export const AliceBlue = registerColor('AliceBlue', 0xfff0f8ff);
|
25 | export const AntiqueWhite = registerColor('AntiqueWhite', 0xfffaebd7);
|
26 | export const Aqua = registerColor('Aqua', 0xff00ffff);
|
27 | export const Aquamarine = registerColor('Aquamarine', 0xff7fffd4);
|
28 | export const Azure = registerColor('Azure', 0xfff0ffff);
|
29 | export const Beige = registerColor('Beige', 0xfff5f5dc);
|
30 | export const Bisque = registerColor('Bisque', 0xffffe4c4);
|
31 | export const Black = registerColor('Black', 0xff000000);
|
32 | export const BlanchedAlmond = registerColor('BlanchedAlmond', 0xffffebcd);
|
33 | export const Blue = registerColor('Blue', 0xff0000ff);
|
34 | export const BlueViolet = registerColor('BlueViolet', 0xff8a2be2);
|
35 | export const Brown = registerColor('Brown', 0xffa52a2a);
|
36 | export const BurlyWood = registerColor('BurlyWood', 0xffdeb887);
|
37 | export const CadetBlue = registerColor('CadetBlue', 0xff5f9ea0);
|
38 | export const Chartreuse = registerColor('Chartreuse', 0xff7fff00);
|
39 | export const Chocolate = registerColor('Chocolate', 0xffd2691e);
|
40 | export const Coral = registerColor('Coral', 0xffff7f50);
|
41 | export const CornflowerBlue = registerColor('CornflowerBlue', 0xff6495ed);
|
42 | export const Cornsilk = registerColor('Cornsilk', 0xfffff8dc);
|
43 | export const Crimson = registerColor('Crimson', 0xffdc143c);
|
44 | export const Cyan = registerColor('Cyan', 0xff00ffff);
|
45 | export const DarkBlue = registerColor('DarkBlue', 0xff00008b);
|
46 | export const DarkCyan = registerColor('DarkCyan', 0xff008b8b);
|
47 | export const DarkGoldenRod = registerColor('DarkGoldenRod', 0xffb8860b);
|
48 | export const DarkGray = registerColor(['DarkGray', 'DarkGrey'], 0xffa9a9a9);
|
49 | export const DarkGreen = registerColor('DarkGreen', 0xff006400);
|
50 | export const DarkKhaki = registerColor('DarkKhaki', 0xffbdb76b);
|
51 | export const DarkMagenta = registerColor('DarkMagenta', 0xff8b008b);
|
52 | export const DarkOliveGreen = registerColor('DarkOliveGreen', 0xff556b2f);
|
53 | export const DarkOrange = registerColor('DarkOrange', 0xffff8c00);
|
54 | export const DarkOrchid = registerColor('DarkOrchid', 0xff9932cc);
|
55 | export const DarkRed = registerColor('DarkRed', 0xff8b0000);
|
56 | export const DarkSalmon = registerColor('DarkSalmon', 0xffe9967a);
|
57 | export const DarkSeaGreen = registerColor('DarkSeaGreen', 0xff8fbc8f);
|
58 | export const DarkSlateBlue = registerColor('DarkSlateBlue', 0xff483d8b);
|
59 | export const DarkSlateGray = registerColor(['DarkSlateGray', 'DarkSlateGrey'], 0xff2f4f4f);
|
60 | export const DarkTurquoise = registerColor('DarkTurquoise', 0xff00ced1);
|
61 | export const DarkViolet = registerColor('DarkViolet', 0xff9400d3);
|
62 | export const DeepPink = registerColor('DeepPink', 0xffff1493);
|
63 | export const DeepSkyBlue = registerColor('DeepSkyBlue', 0xff00bfff);
|
64 | export const DimGray = registerColor(['DimGray', 'DimGrey'], 0xff696969);
|
65 | export const DodgerBlue = registerColor('DodgerBlue', 0xff1e90ff);
|
66 | export const FireBrick = registerColor('FireBrick', 0xffb22222);
|
67 | export const FloralWhite = registerColor('FloralWhite', 0xfffffaf0);
|
68 | export const ForestGreen = registerColor('ForestGreen', 0xff228b22);
|
69 | export const Fuchsia = registerColor('Fuchsia', 0xffff00ff);
|
70 | export const Gainsboro = registerColor('Gainsboro', 0xffdcdcdc);
|
71 | export const GhostWhite = registerColor('GhostWhite', 0xfff8f8ff);
|
72 | export const Gold = registerColor('Gold', 0xffffd700);
|
73 | export const GoldenRod = registerColor('GoldenRod', 0xffdaa520);
|
74 | export const Gray = registerColor(['Gray', 'Grey'], 0xff808080);
|
75 | export const Green = registerColor('Green', 0xff008000);
|
76 | export const GreenYellow = registerColor('GreenYellow', 0xffadff2f);
|
77 | export const HoneyDew = registerColor('HoneyDew', 0xfff0fff0);
|
78 | export const HotPink = registerColor('HotPink', 0xffff69b4);
|
79 | export const IndianRed = registerColor('IndianRed', 0xffcd5c5c);
|
80 | export const Indigo = registerColor('Indigo', 0xff4b0082);
|
81 | export const Ivory = registerColor('Ivory', 0xfffffff0);
|
82 | export const Khaki = registerColor('Khaki', 0xfff0e68c);
|
83 | export const Lavender = registerColor('Lavender', 0xffe6e6fa);
|
84 | export const LavenderBlush = registerColor('LavenderBlush', 0xfffff0f5);
|
85 | export const LawnGreen = registerColor('LawnGreen', 0xff7cfc00);
|
86 | export const LemonChiffon = registerColor('LemonChiffon', 0xfffffacd);
|
87 | export const LightBlue = registerColor('LightBlue', 0xffadd8e6);
|
88 | export const LightCoral = registerColor('LightCoral', 0xfff08080);
|
89 | export const LightCyan = registerColor('LightCyan', 0xffe0ffff);
|
90 | export const LightGoldenRodYellow = registerColor('LightGoldenRodYellow', 0xfffafad2);
|
91 | export const LightGray = registerColor(['LightGray', 'LightGrey'], 0xffd3d3d3);
|
92 | export const LightGreen = registerColor('LightGreen', 0xff90ee90);
|
93 | export const LightPink = registerColor('LightPink', 0xffffb6c1);
|
94 | export const LightSalmon = registerColor('LightSalmon', 0xffffa07a);
|
95 | export const LightSeaGreen = registerColor('LightSeaGreen', 0xff20b2aa);
|
96 | export const LightSkyBlue = registerColor('LightSkyBlue', 0xff87cefa);
|
97 | export const LightSlateGray = registerColor(['LightSlateGray', 'LightSlateGrey'], 0xff778899);
|
98 | export const LightSteelBlue = registerColor('LightSteelBlue', 0xffb0c4de);
|
99 | export const LightYellow = registerColor('LightYellow', 0xffffffe0);
|
100 | export const Lime = registerColor('Lime', 0xff00ff00);
|
101 | export const LimeGreen = registerColor('LimeGreen', 0xff32cd32);
|
102 | export const Linen = registerColor('Linen', 0xfffaf0e6);
|
103 | export const Magenta = registerColor('Magenta', 0xffff00ff);
|
104 | export const Maroon = registerColor('Maroon', 0xff800000);
|
105 | export const MediumAquaMarine = registerColor('MediumAquaMarine', 0xff66cdaa);
|
106 | export const MediumBlue = registerColor('MediumBlue', 0xff0000cd);
|
107 | export const MediumOrchid = registerColor('MediumOrchid', 0xffba55d3);
|
108 | export const MediumPurple = registerColor('MediumPurple', 0xff9370db);
|
109 | export const MediumSeaGreen = registerColor('MediumSeaGreen', 0xff3cb371);
|
110 | export const MediumSlateBlue = registerColor('MediumSlateBlue', 0xff7b68ee);
|
111 | export const MediumSpringGreen = registerColor('MediumSpringGreen', 0xff00fa9a);
|
112 | export const MediumTurquoise = registerColor('MediumTurquoise', 0xff48d1cc);
|
113 | export const MediumVioletRed = registerColor('MediumVioletRed', 0xffc71585);
|
114 | export const MidnightBlue = registerColor('MidnightBlue', 0xff191970);
|
115 | export const MintCream = registerColor('MintCream', 0xfff5fffa);
|
116 | export const MistyRose = registerColor('MistyRose', 0xffffe4e1);
|
117 | export const Moccasin = registerColor('Moccasin', 0xffffe4b5);
|
118 | export const NavajoWhite = registerColor('NavajoWhite', 0xffffdead);
|
119 | export const Navy = registerColor('Navy', 0xff000080);
|
120 | export const OldLace = registerColor('OldLace', 0xfffdf5e6);
|
121 | export const Olive = registerColor('Olive', 0xff808000);
|
122 | export const OliveDrab = registerColor('OliveDrab', 0xff6b8e23);
|
123 | export const Orange = registerColor('Orange', 0xffffa500);
|
124 | export const OrangeRed = registerColor('OrangeRed', 0xffff4500);
|
125 | export const Orchid = registerColor('Orchid', 0xffda70d6);
|
126 | export const PaleGoldenRod = registerColor('PaleGoldenRod', 0xffeee8aa);
|
127 | export const PaleGreen = registerColor('PaleGreen', 0xff98fb98);
|
128 | export const PaleTurquoise = registerColor('PaleTurquoise', 0xffafeeee);
|
129 | export const PaleVioletRed = registerColor('PaleVioletRed', 0xffdb7093);
|
130 | export const PapayaWhip = registerColor('PapayaWhip', 0xffffefd5);
|
131 | export const PeachPuff = registerColor('PeachPuff', 0xffffdab9);
|
132 | export const Peru = registerColor('Peru', 0xffcd853f);
|
133 | export const Pink = registerColor('Pink', 0xffffc0cb);
|
134 | export const Plum = registerColor('Plum', 0xffdda0dd);
|
135 | export const PowderBlue = registerColor('PowderBlue', 0xffb0e0e6);
|
136 | export const Purple = registerColor('Purple', 0xff800080);
|
137 | export const RebeccaPurple = registerColor('RebeccaPurple', 0xff663399);
|
138 | export const Red = registerColor('Red', 0xffff0000);
|
139 | export const RosyBrown = registerColor('RosyBrown', 0xffbc8f8f);
|
140 | export const RoyalBlue = registerColor('RoyalBlue', 0xff4169e1);
|
141 | export const SaddleBrown = registerColor('SaddleBrown', 0xff8b4513);
|
142 | export const Salmon = registerColor('Salmon', 0xfffa8072);
|
143 | export const SandyBrown = registerColor('SandyBrown', 0xfff4a460);
|
144 | export const SeaGreen = registerColor('SeaGreen', 0xff2e8b57);
|
145 | export const SeaShell = registerColor('SeaShell', 0xfffff5ee);
|
146 | export const Sienna = registerColor('Sienna', 0xffa0522d);
|
147 | export const Silver = registerColor('Silver', 0xffc0c0c0);
|
148 | export const SkyBlue = registerColor('SkyBlue', 0xff87ceeb);
|
149 | export const SlateBlue = registerColor('SlateBlue', 0xff6a5acd);
|
150 | export const SlateGray = registerColor(['SlateGray', 'SlateGrey'], 0xff708090);
|
151 | export const Snow = registerColor('Snow', 0xfffffafa);
|
152 | export const SpringGreen = registerColor('SpringGreen', 0xff00ff7f);
|
153 | export const SteelBlue = registerColor('SteelBlue', 0xff4682b4);
|
154 | export const Tan = registerColor('Tan', 0xffd2b48c);
|
155 | export const Teal = registerColor('Teal', 0xff008080);
|
156 | export const Thistle = registerColor('Thistle', 0xffd8bfd8);
|
157 | export const Tomato = registerColor('Tomato', 0xffff6347);
|
158 | export const Turquoise = registerColor('Turquoise', 0xff40e0d0);
|
159 | export const Violet = registerColor('Violet', 0xffee82ee);
|
160 | export const Wheat = registerColor('Wheat', 0xfff5deb3);
|
161 | export const White = registerColor('White', 0xffffffff);
|
162 | export const WhiteSmoke = registerColor('WhiteSmoke', 0xfff5f5f5);
|
163 | export const Yellow = registerColor('Yellow', 0xffffff00);
|
164 | export const YellowGreen = registerColor('YellowGreen', 0xff9acd32);
|
165 |
|
\ | No newline at end of file |