UNPKG

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