-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColorSheet.cs
597 lines (585 loc) · 28.8 KB
/
ColorSheet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
namespace ConsoleColorConverter;
internal static class ColorSheet
{
internal static readonly Color BLACK = new Color(0, "BLACK", 0x000000);
internal static readonly Color MAROON = new Color(1, "MAROON", 0x800000);
internal static readonly Color GREEN = new Color(2, "GREEN", 0x008000);
internal static readonly Color OLIVE = new Color(3, "OLIVE", 0x808000);
internal static readonly Color NAVY = new Color(4, "NAVY", 0x000080);
internal static readonly Color PURPLE = new Color(5, "PURPLE", 0x800080);
internal static readonly Color TEAL = new Color(6, "TEAL", 0x008080);
internal static readonly Color SILVER = new Color(7, "SILVER", 0xc0c0c0);
internal static readonly Color GREY = new Color(8, "GREY", 0x808080);
internal static readonly Color RED = new Color(9, "RED", 0xff0000);
internal static readonly Color LIME = new Color(10, "LIME", 0x00ff00);
internal static readonly Color YELLOW = new Color(11, "YELLOW", 0xffff00);
internal static readonly Color BLUE = new Color(12, "BLUE", 0x0000ff);
internal static readonly Color FUCHSIA = new Color(13, "FUCHSIA", 0xff00ff);
internal static readonly Color AQUA = new Color(14, "AQUA", 0x00ffff);
internal static readonly Color WHITE = new Color(15, "WHITE", 0xffffff);
internal static readonly Color GREY1 = new Color(16, "GREY1", 0x000000);
internal static readonly Color NAVYBLUE1 = new Color(17, "NAVYBLUE1", 0x00005f);
internal static readonly Color DARKBLUE1 = new Color(18, "DARKBLUE1", 0x000087);
internal static readonly Color BLUE1 = new Color(19, "BLUE1", 0x0000af);
internal static readonly Color BLUE2 = new Color(20, "BLUE2", 0x0000d7);
internal static readonly Color BLUE3 = new Color(21, "BLUE3", 0x0000ff);
internal static readonly Color DARKGREEN1 = new Color(22, "DARKGREEN1", 0x005f00);
internal static readonly Color DEEPSKYBLUE1 = new Color(23, "DEEPSKYBLUE1", 0x005f5f);
internal static readonly Color DEEPSKYBLUE2 = new Color(24, "DEEPSKYBLUE2", 0x005f87);
internal static readonly Color DEEPSKYBLUE3 = new Color(25, "DEEPSKYBLUE3", 0x005faf);
internal static readonly Color DODGERBLUE1 = new Color(26, "DODGERBLUE1", 0x005fd7);
internal static readonly Color DODGERBLUE2 = new Color(27, "DODGERBLUE2", 0x005fff);
internal static readonly Color GREEN1 = new Color(28, "GREEN1", 0x008700);
internal static readonly Color SPRINGGREEN1 = new Color(29, "SPRINGGREEN1", 0x00875f);
internal static readonly Color TURQUOISE1 = new Color(30, "TURQUOISE1", 0x008787);
internal static readonly Color DEEPSKYBLUE4 = new Color(31, "DEEPSKYBLUE4", 0x0087af);
internal static readonly Color DEEPSKYBLUE5 = new Color(32, "DEEPSKYBLUE5", 0x0087d7);
internal static readonly Color DODGERBLUE3 = new Color(33, "DODGERBLUE3", 0x0087ff);
internal static readonly Color GREEN2 = new Color(34, "GREEN2", 0x00af00);
internal static readonly Color SPRINGGREEN2 = new Color(35, "SPRINGGREEN2", 0x00af5f);
internal static readonly Color DARKCYAN1 = new Color(36, "DARKCYAN1", 0x00af87);
internal static readonly Color LIGHTSEAGREEN1 = new Color(37, "LIGHTSEAGREEN1", 0x00afaf);
internal static readonly Color DEEPSKYBLUE6 = new Color(38, "DEEPSKYBLUE6", 0x00afd7);
internal static readonly Color DEEPSKYBLUE7 = new Color(39, "DEEPSKYBLUE7", 0x00afff);
internal static readonly Color GREEN3 = new Color(40, "GREEN3", 0x00d700);
internal static readonly Color SPRINGGREEN3 = new Color(41, "SPRINGGREEN3", 0x00d75f);
internal static readonly Color SPRINGGREEN4 = new Color(42, "SPRINGGREEN4", 0x00d787);
internal static readonly Color CYAN1 = new Color(43, "CYAN1", 0x00d7af);
internal static readonly Color DARKTURQUOISE1 = new Color(44, "DARKTURQUOISE1", 0x00d7d7);
internal static readonly Color TURQUOISE2 = new Color(45, "TURQUOISE2", 0x00d7ff);
internal static readonly Color GREEN4 = new Color(46, "GREEN4", 0x00ff00);
internal static readonly Color SPRINGGREEN5 = new Color(47, "SPRINGGREEN5", 0x00ff5f);
internal static readonly Color SPRINGGREEN6 = new Color(48, "SPRINGGREEN6", 0x00ff87);
internal static readonly Color MEDIUMSPRINGGREEN1 = new Color(49, "MEDIUMSPRINGGREEN1", 0x00ffaf);
internal static readonly Color CYAN2 = new Color(50, "CYAN2", 0x00ffd7);
internal static readonly Color CYAN3 = new Color(51, "CYAN3", 0x00ffff);
internal static readonly Color DARKRED1 = new Color(52, "DARKRED1", 0x5f0000);
internal static readonly Color DEEPPINK1 = new Color(53, "DEEPPINK1", 0x5f005f);
internal static readonly Color PURPLE1 = new Color(54, "PURPLE1", 0x5f0087);
internal static readonly Color PURPLE2 = new Color(55, "PURPLE2", 0x5f00af);
internal static readonly Color PURPLE3 = new Color(56, "PURPLE3", 0x5f00d7);
internal static readonly Color BLUEVIOLET1 = new Color(57, "BLUEVIOLET1", 0x5f00ff);
internal static readonly Color ORANGE1 = new Color(58, "ORANGE1", 0x5f5f00);
internal static readonly Color GREY11 = new Color(59, "GREY11", 0x5f5f5f);
internal static readonly Color MEDIUMPURPLE1 = new Color(60, "MEDIUMPURPLE1", 0x5f5f87);
internal static readonly Color SLATEBLUE1 = new Color(61, "SLATEBLUE1", 0x5f5faf);
internal static readonly Color SLATEBLUE2 = new Color(62, "SLATEBLUE2", 0x5f5fd7);
internal static readonly Color ROYALBLUE1 = new Color(63, "ROYALBLUE1", 0x5f5fff);
internal static readonly Color CHARTREUSE1 = new Color(64, "CHARTREUSE1", 0x5f8700);
internal static readonly Color DARKSEAGREEN1 = new Color(65, "DARKSEAGREEN1", 0x5f875f);
internal static readonly Color PALETURQUOISE1 = new Color(66, "PALETURQUOISE1", 0x5f8787);
internal static readonly Color STEELBLUE1 = new Color(67, "STEELBLUE1", 0x5f87af);
internal static readonly Color STEELBLUE2 = new Color(68, "STEELBLUE2", 0x5f87d7);
internal static readonly Color CORNFLOWERBLUE1 = new Color(69, "CORNFLOWERBLUE1", 0x5f87ff);
internal static readonly Color CHARTREUSE2 = new Color(70, "CHARTREUSE2", 0x5faf00);
internal static readonly Color DARKSEAGREEN2 = new Color(71, "DARKSEAGREEN2", 0x5faf5f);
internal static readonly Color CADETBLUE1 = new Color(72, "CADETBLUE1", 0x5faf87);
internal static readonly Color CADETBLUE2 = new Color(73, "CADETBLUE2", 0x5fafaf);
internal static readonly Color SKYBLUE1 = new Color(74, "SKYBLUE1", 0x5fafd7);
internal static readonly Color STEELBLUE3 = new Color(75, "STEELBLUE3", 0x5fafff);
internal static readonly Color CHARTREUSE3 = new Color(76, "CHARTREUSE3", 0x5fd700);
internal static readonly Color PALEGREEN1 = new Color(77, "PALEGREEN1", 0x5fd75f);
internal static readonly Color SEAGREEN1 = new Color(78, "SEAGREEN1", 0x5fd787);
internal static readonly Color AQUAMARINE1 = new Color(79, "AQUAMARINE1", 0x5fd7af);
internal static readonly Color MEDIUMTURQUOISE1 = new Color(80, "MEDIUMTURQUOISE1", 0x5fd7d7);
internal static readonly Color STEELBLUE4 = new Color(81, "STEELBLUE4", 0x5fd7ff);
internal static readonly Color CHARTREUSE4 = new Color(82, "CHARTREUSE4", 0x5fff00);
internal static readonly Color SEAGREEN2 = new Color(83, "SEAGREEN2", 0x5fff5f);
internal static readonly Color SEAGREEN3 = new Color(84, "SEAGREEN3", 0x5fff87);
internal static readonly Color SEAGREEN4 = new Color(85, "SEAGREEN4", 0x5fffaf);
internal static readonly Color AQUAMARINE2 = new Color(86, "AQUAMARINE2", 0x5fffd7);
internal static readonly Color DARKSLATEGRAY2 = new Color(87, "DARKSLATEGRAY2", 0x5fffff);
internal static readonly Color DARKRED2 = new Color(88, "DARKRED2", 0x870000);
internal static readonly Color DEEPPINK2 = new Color(89, "DEEPPINK2", 0x87005f);
internal static readonly Color DARKMAGENTA1 = new Color(90, "DARKMAGENTA1", 0x870087);
internal static readonly Color DARKMAGENTA2 = new Color(91, "DARKMAGENTA2", 0x8700af);
internal static readonly Color DARKVIOLET1 = new Color(92, "DARKVIOLET1", 0x8700d7);
internal static readonly Color PURPLE4 = new Color(93, "PURPLE4", 0x8700ff);
internal static readonly Color ORANGE2 = new Color(94, "ORANGE2", 0x875f00);
internal static readonly Color LIGHTPINK1 = new Color(95, "LIGHTPINK1", 0x875f5f);
internal static readonly Color PLUM1 = new Color(96, "PLUM1", 0x875f87);
internal static readonly Color MEDIUMPURPLE2 = new Color(97, "MEDIUMPURPLE2", 0x875faf);
internal static readonly Color MEDIUMPURPLE3 = new Color(98, "MEDIUMPURPLE3", 0x875fd7);
internal static readonly Color SLATEBLUE3 = new Color(99, "SLATEBLUE3", 0x875fff);
internal static readonly Color YELLOW1 = new Color(100, "YELLOW1", 0x878700);
internal static readonly Color WHEAT1 = new Color(101, "WHEAT1", 0x87875f);
internal static readonly Color GREY16 = new Color(102, "GREY16", 0x878787);
internal static readonly Color LIGHTSLATEGREY1 = new Color(103, "LIGHTSLATEGREY1", 0x8787af);
internal static readonly Color MEDIUMPURPLE4 = new Color(104, "MEDIUMPURPLE4", 0x8787d7);
internal static readonly Color LIGHTSLATEBLUE1 = new Color(105, "LIGHTSLATEBLUE1", 0x8787ff);
internal static readonly Color YELLOW2 = new Color(106, "YELLOW2", 0x87af00);
internal static readonly Color DARKOLIVEGREEN1 = new Color(107, "DARKOLIVEGREEN1", 0x87af5f);
internal static readonly Color DARKSEAGREEN3 = new Color(108, "DARKSEAGREEN3", 0x87af87);
internal static readonly Color LIGHTSKYBLUE1 = new Color(109, "LIGHTSKYBLUE1", 0x87afaf);
internal static readonly Color LIGHTSKYBLUE2 = new Color(110, "LIGHTSKYBLUE2", 0x87afd7);
internal static readonly Color SKYBLUE2 = new Color(111, "SKYBLUE2", 0x87afff);
internal static readonly Color CHARTREUSE5 = new Color(112, "CHARTREUSE5", 0x87d700);
internal static readonly Color DARKOLIVEGREEN2 = new Color(113, "DARKOLIVEGREEN2", 0x87d75f);
internal static readonly Color PALEGREEN2 = new Color(114, "PALEGREEN2", 0x87d787);
internal static readonly Color DARKSEAGREEN4 = new Color(115, "DARKSEAGREEN4", 0x87d7af);
internal static readonly Color DARKSLATEGRAY1 = new Color(116, "DARKSLATEGRAY1", 0x87d7d7);
internal static readonly Color SKYBLUE3 = new Color(117, "SKYBLUE3", 0x87d7ff);
internal static readonly Color CHARTREUSE6 = new Color(118, "CHARTREUSE6", 0x87ff00);
internal static readonly Color LIGHTGREEN1 = new Color(119, "LIGHTGREEN1", 0x87ff5f);
internal static readonly Color LIGHTGREEN2 = new Color(120, "LIGHTGREEN2", 0x87ff87);
internal static readonly Color PALEGREEN3 = new Color(121, "PALEGREEN3", 0x87ffaf);
internal static readonly Color AQUAMARINE3 = new Color(122, "AQUAMARINE3", 0x87ffd7);
internal static readonly Color DARKSLATEGRAY3 = new Color(123, "DARKSLATEGRAY3", 0x87ffff);
internal static readonly Color RED1 = new Color(124, "RED1", 0xaf0000);
internal static readonly Color DEEPPINK3 = new Color(125, "DEEPPINK3", 0xaf005f);
internal static readonly Color MEDIUMVIOLETRED1 = new Color(126, "MEDIUMVIOLETRED1", 0xaf0087);
internal static readonly Color MAGENTA1 = new Color(127, "MAGENTA1", 0xaf00af);
internal static readonly Color DARKVIOLET2 = new Color(128, "DARKVIOLET2", 0xaf00d7);
internal static readonly Color PURPLE5 = new Color(129, "PURPLE5", 0xaf00ff);
internal static readonly Color DARKORANGE1 = new Color(130, "DARKORANGE1", 0xaf5f00);
internal static readonly Color INDIANRED1 = new Color(131, "INDIANRED1", 0xaf5f5f);
internal static readonly Color HOTPINK1 = new Color(132, "HOTPINK1", 0xaf5f87);
internal static readonly Color MEDIUMORCHID1 = new Color(133, "MEDIUMORCHID1", 0xaf5faf);
internal static readonly Color MEDIUMORCHID2 = new Color(134, "MEDIUMORCHID2", 0xaf5fd7);
internal static readonly Color MEDIUMPURPLE5 = new Color(135, "MEDIUMPURPLE5", 0xaf5fff);
internal static readonly Color DARKGOLDENROD1 = new Color(136, "DARKGOLDENROD1", 0xaf8700);
internal static readonly Color LIGHTSALMON1 = new Color(137, "LIGHTSALMON1", 0xaf875f);
internal static readonly Color ROSYBROWN1 = new Color(138, "ROSYBROWN1", 0xaf8787);
internal static readonly Color GREY20 = new Color(139, "GREY20", 0xaf87af);
internal static readonly Color MEDIUMPURPLE6 = new Color(140, "MEDIUMPURPLE6", 0xaf87d7);
internal static readonly Color MEDIUMPURPLE7 = new Color(141, "MEDIUMPURPLE7", 0xaf87ff);
internal static readonly Color GOLD1 = new Color(142, "GOLD1", 0xafaf00);
internal static readonly Color DARKKHAKI1 = new Color(143, "DARKKHAKI1", 0xafaf5f);
internal static readonly Color NAVAJOWHITE1 = new Color(144, "NAVAJOWHITE1", 0xafaf87);
internal static readonly Color GREY22 = new Color(145, "GREY22", 0xafafaf);
internal static readonly Color LIGHTSTEELBLUE1 = new Color(146, "LIGHTSTEELBLUE1", 0xafafd7);
internal static readonly Color LIGHTSTEELBLUE2 = new Color(147, "LIGHTSTEELBLUE2", 0xafafff);
internal static readonly Color YELLOW3 = new Color(148, "YELLOW3", 0xafd700);
internal static readonly Color DARKOLIVEGREEN3 = new Color(149, "DARKOLIVEGREEN3", 0xafd75f);
internal static readonly Color DARKSEAGREEN5 = new Color(150, "DARKSEAGREEN5", 0xafd787);
internal static readonly Color DARKSEAGREEN6 = new Color(151, "DARKSEAGREEN6", 0xafd7af);
internal static readonly Color LIGHTCYAN1 = new Color(152, "LIGHTCYAN1", 0xafd7d7);
internal static readonly Color LIGHTSKYBLUE3 = new Color(153, "LIGHTSKYBLUE3", 0xafd7ff);
internal static readonly Color GREENYELLOW1 = new Color(154, "GREENYELLOW1", 0xafff00);
internal static readonly Color DARKOLIVEGREEN4 = new Color(155, "DARKOLIVEGREEN4", 0xafff5f);
internal static readonly Color PALEGREEN4 = new Color(156, "PALEGREEN4", 0xafff87);
internal static readonly Color DARKSEAGREEN7 = new Color(157, "DARKSEAGREEN7", 0xafffaf);
internal static readonly Color DARKSEAGREEN8 = new Color(158, "DARKSEAGREEN8", 0xafffd7);
internal static readonly Color PALETURQUOISE2 = new Color(159, "PALETURQUOISE2", 0xafffff);
internal static readonly Color RED2 = new Color(160, "RED2", 0xd70000);
internal static readonly Color DEEPPINK4 = new Color(161, "DEEPPINK4", 0xd7005f);
internal static readonly Color DEEPPINK5 = new Color(162, "DEEPPINK5", 0xd70087);
internal static readonly Color MAGENTA2 = new Color(163, "MAGENTA2", 0xd700af);
internal static readonly Color MAGENTA3 = new Color(164, "MAGENTA3", 0xd700d7);
internal static readonly Color MAGENTA4 = new Color(165, "MAGENTA4", 0xd700ff);
internal static readonly Color DARKORANGE2 = new Color(166, "DARKORANGE2", 0xd75f00);
internal static readonly Color INDIANRED2 = new Color(167, "INDIANRED2", 0xd75f5f);
internal static readonly Color HOTPINK2 = new Color(168, "HOTPINK2", 0xd75f87);
internal static readonly Color HOTPINK3 = new Color(169, "HOTPINK3", 0xd75faf);
internal static readonly Color ORCHID1 = new Color(170, "ORCHID1", 0xd75fd7);
internal static readonly Color MEDIUMORCHID3 = new Color(171, "MEDIUMORCHID3", 0xd75fff);
internal static readonly Color ORANGE3 = new Color(172, "ORANGE3", 0xd78700);
internal static readonly Color LIGHTSALMON2 = new Color(173, "LIGHTSALMON2", 0xd7875f);
internal static readonly Color LIGHTPINK2 = new Color(174, "LIGHTPINK2", 0xd78787);
internal static readonly Color PINK1 = new Color(175, "PINK1", 0xd787af);
internal static readonly Color PLUM2 = new Color(176, "PLUM2", 0xd787d7);
internal static readonly Color VIOLET1 = new Color(177, "VIOLET1", 0xd787ff);
internal static readonly Color GOLD2 = new Color(178, "GOLD2", 0xd7af00);
internal static readonly Color LIGHTGOLDENROD1 = new Color(179, "LIGHTGOLDENROD1", 0xd7af5f);
internal static readonly Color TAN1 = new Color(180, "TAN1", 0xd7af87);
internal static readonly Color MISTYROSE1 = new Color(181, "MISTYROSE1", 0xd7afaf);
internal static readonly Color THISTLE1 = new Color(182, "THISTLE1", 0xd7afd7);
internal static readonly Color PLUM3 = new Color(183, "PLUM3", 0xd7afff);
internal static readonly Color YELLOW4 = new Color(184, "YELLOW4", 0xd7d700);
internal static readonly Color KHAKI1 = new Color(185, "KHAKI1", 0xd7d75f);
internal static readonly Color LIGHTGOLDENROD2 = new Color(186, "LIGHTGOLDENROD2", 0xd7d787);
internal static readonly Color LIGHTYELLOW1 = new Color(187, "LIGHTYELLOW1", 0xd7d7af);
internal static readonly Color GREY27 = new Color(188, "GREY27", 0xd7d7d7);
internal static readonly Color LIGHTSTEELBLUE3 = new Color(189, "LIGHTSTEELBLUE3", 0xd7d7ff);
internal static readonly Color YELLOW5 = new Color(190, "YELLOW5", 0xd7ff00);
internal static readonly Color DARKOLIVEGREEN5 = new Color(191, "DARKOLIVEGREEN5", 0xd7ff5f);
internal static readonly Color DARKOLIVEGREEN6 = new Color(192, "DARKOLIVEGREEN6", 0xd7ff87);
internal static readonly Color DARKSEAGREEN9 = new Color(193, "DARKSEAGREEN9", 0xd7ffaf);
internal static readonly Color HONEYDEW1 = new Color(194, "HONEYDEW1", 0xd7ffd7);
internal static readonly Color LIGHTCYAN2 = new Color(195, "LIGHTCYAN2", 0xd7ffff);
internal static readonly Color RED3 = new Color(196, "RED3", 0xff0000);
internal static readonly Color DEEPPINK6 = new Color(197, "DEEPPINK6", 0xff005f);
internal static readonly Color DEEPPINK7 = new Color(198, "DEEPPINK7", 0xff0087);
internal static readonly Color DEEPPINK8 = new Color(199, "DEEPPINK8", 0xff00af);
internal static readonly Color MAGENTA5 = new Color(200, "MAGENTA5", 0xff00d7);
internal static readonly Color MAGENTA6 = new Color(201, "MAGENTA6", 0xff00ff);
internal static readonly Color ORANGERED1 = new Color(202, "ORANGERED1", 0xff5f00);
internal static readonly Color INDIANRED3 = new Color(203, "INDIANRED3", 0xff5f5f);
internal static readonly Color INDIANRED4 = new Color(204, "INDIANRED4", 0xff5f87);
internal static readonly Color HOTPINK4 = new Color(205, "HOTPINK4", 0xff5faf);
internal static readonly Color HOTPINK5 = new Color(206, "HOTPINK5", 0xff5fd7);
internal static readonly Color MEDIUMORCHID4 = new Color(207, "MEDIUMORCHID4", 0xff5fff);
internal static readonly Color DARKORANGE3 = new Color(208, "DARKORANGE3", 0xff8700);
internal static readonly Color SALMON1 = new Color(209, "SALMON1", 0xff875f);
internal static readonly Color LIGHTCORAL1 = new Color(210, "LIGHTCORAL1", 0xff8787);
internal static readonly Color PALEVIOLETRED1 = new Color(211, "PALEVIOLETRED1", 0xff87af);
internal static readonly Color ORCHID2 = new Color(212, "ORCHID2", 0xff87d7);
internal static readonly Color ORCHID3 = new Color(213, "ORCHID3", 0xff87ff);
internal static readonly Color ORANGE4 = new Color(214, "ORANGE4", 0xffaf00);
internal static readonly Color SANDYBROWN1 = new Color(215, "SANDYBROWN1", 0xffaf5f);
internal static readonly Color LIGHTSALMON3 = new Color(216, "LIGHTSALMON3", 0xffaf87);
internal static readonly Color LIGHTPINK3 = new Color(217, "LIGHTPINK3", 0xffafaf);
internal static readonly Color PINK2 = new Color(218, "PINK2", 0xffafd7);
internal static readonly Color PLUM4 = new Color(219, "PLUM4", 0xffafff);
internal static readonly Color GOLD3 = new Color(220, "GOLD3", 0xffd700);
internal static readonly Color LIGHTGOLDENROD3 = new Color(221, "LIGHTGOLDENROD3", 0xffd75f);
internal static readonly Color LIGHTGOLDENROD4 = new Color(222, "LIGHTGOLDENROD4", 0xffd787);
internal static readonly Color NAVAJOWHITE2 = new Color(223, "NAVAJOWHITE2", 0xffd7af);
internal static readonly Color MISTYROSE2 = new Color(224, "MISTYROSE2", 0xffd7d7);
internal static readonly Color THISTLE2 = new Color(225, "THISTLE2", 0xffd7ff);
internal static readonly Color YELLOW6 = new Color(226, "YELLOW6", 0xffff00);
internal static readonly Color LIGHTGOLDENROD5 = new Color(227, "LIGHTGOLDENROD5", 0xffff5f);
internal static readonly Color KHAKI2 = new Color(228, "KHAKI2", 0xffff87);
internal static readonly Color WHEAT2 = new Color(229, "WHEAT2", 0xffffaf);
internal static readonly Color CORNSILK1 = new Color(230, "CORNSILK1", 0xffffd7);
internal static readonly Color GREY31 = new Color(231, "GREY31", 0xffffff);
internal static readonly Color GREY2 = new Color(232, "GREY2", 0x080808);
internal static readonly Color GREY3 = new Color(233, "GREY3", 0x121212);
internal static readonly Color GREY4 = new Color(234, "GREY4", 0x1c1c1c);
internal static readonly Color GREY5 = new Color(235, "GREY5", 0x262626);
internal static readonly Color GREY6 = new Color(236, "GREY6", 0x303030);
internal static readonly Color GREY7 = new Color(237, "GREY7", 0x3a3a3a);
internal static readonly Color GREY8 = new Color(238, "GREY8", 0x444444);
internal static readonly Color GREY9 = new Color(239, "GREY9", 0x4e4e4e);
internal static readonly Color GREY10 = new Color(240, "GREY10", 0x585858);
internal static readonly Color GREY12 = new Color(241, "GREY12", 0x626262);
internal static readonly Color GREY13 = new Color(242, "GREY13", 0x6c6c6c);
internal static readonly Color GREY14 = new Color(243, "GREY14", 0x767676);
internal static readonly Color GREY15 = new Color(244, "GREY15", 0x808080);
internal static readonly Color GREY17 = new Color(245, "GREY17", 0x8a8a8a);
internal static readonly Color GREY18 = new Color(246, "GREY18", 0x949494);
internal static readonly Color GREY19 = new Color(247, "GREY19", 0x9e9e9e);
internal static readonly Color GREY21 = new Color(248, "GREY21", 0xa8a8a8);
internal static readonly Color GREY23 = new Color(249, "GREY23", 0xb2b2b2);
internal static readonly Color GREY24 = new Color(250, "GREY24", 0xbcbcbc);
internal static readonly Color GREY25 = new Color(251, "GREY25", 0xc6c6c6);
internal static readonly Color GREY26 = new Color(252, "GREY26", 0xd0d0d0);
internal static readonly Color GREY28 = new Color(253, "GREY28", 0xdadada);
internal static readonly Color GREY29 = new Color(254, "GREY29", 0xe4e4e4);
internal static readonly Color GREY30 = new Color(255, "GREY30", 0xeeeeee);
internal static readonly Color[] COLORS = new Color[]
{
BLACK,
MAROON,
GREEN,
OLIVE,
NAVY,
PURPLE,
TEAL,
SILVER,
GREY,
RED,
LIME,
YELLOW,
BLUE,
FUCHSIA,
AQUA,
WHITE,
GREY1,
NAVYBLUE1,
DARKBLUE1,
BLUE1,
BLUE2,
BLUE3,
DARKGREEN1,
DEEPSKYBLUE1,
DEEPSKYBLUE2,
DEEPSKYBLUE3,
DODGERBLUE1,
DODGERBLUE2,
GREEN1,
SPRINGGREEN1,
TURQUOISE1,
DEEPSKYBLUE4,
DEEPSKYBLUE5,
DODGERBLUE3,
GREEN2,
SPRINGGREEN2,
DARKCYAN1,
LIGHTSEAGREEN1,
DEEPSKYBLUE6,
DEEPSKYBLUE7,
GREEN3,
SPRINGGREEN3,
SPRINGGREEN4,
CYAN1,
DARKTURQUOISE1,
TURQUOISE2,
GREEN4,
SPRINGGREEN5,
SPRINGGREEN6,
MEDIUMSPRINGGREEN1,
CYAN2,
CYAN3,
DARKRED1,
DEEPPINK1,
PURPLE1,
PURPLE2,
PURPLE3,
BLUEVIOLET1,
ORANGE1,
GREY11,
MEDIUMPURPLE1,
SLATEBLUE1,
SLATEBLUE2,
ROYALBLUE1,
CHARTREUSE1,
DARKSEAGREEN1,
PALETURQUOISE1,
STEELBLUE1,
STEELBLUE2,
CORNFLOWERBLUE1,
CHARTREUSE2,
DARKSEAGREEN2,
CADETBLUE1,
CADETBLUE2,
SKYBLUE1,
STEELBLUE3,
CHARTREUSE3,
PALEGREEN1,
SEAGREEN1,
AQUAMARINE1,
MEDIUMTURQUOISE1,
STEELBLUE4,
CHARTREUSE4,
SEAGREEN2,
SEAGREEN3,
SEAGREEN4,
AQUAMARINE2,
DARKSLATEGRAY2,
DARKRED2,
DEEPPINK2,
DARKMAGENTA1,
DARKMAGENTA2,
DARKVIOLET1,
PURPLE4,
ORANGE2,
LIGHTPINK1,
PLUM1,
MEDIUMPURPLE2,
MEDIUMPURPLE3,
SLATEBLUE3,
YELLOW1,
WHEAT1,
GREY16,
LIGHTSLATEGREY1,
MEDIUMPURPLE4,
LIGHTSLATEBLUE1,
YELLOW2,
DARKOLIVEGREEN1,
DARKSEAGREEN3,
LIGHTSKYBLUE1,
LIGHTSKYBLUE2,
SKYBLUE2,
CHARTREUSE5,
DARKOLIVEGREEN2,
PALEGREEN2,
DARKSEAGREEN4,
DARKSLATEGRAY1,
SKYBLUE3,
CHARTREUSE6,
LIGHTGREEN1,
LIGHTGREEN2,
PALEGREEN3,
AQUAMARINE3,
DARKSLATEGRAY3,
RED1,
DEEPPINK3,
MEDIUMVIOLETRED1,
MAGENTA1,
DARKVIOLET2,
PURPLE5,
DARKORANGE1,
INDIANRED1,
HOTPINK1,
MEDIUMORCHID1,
MEDIUMORCHID2,
MEDIUMPURPLE5,
DARKGOLDENROD1,
LIGHTSALMON1,
ROSYBROWN1,
GREY20,
MEDIUMPURPLE6,
MEDIUMPURPLE7,
GOLD1,
DARKKHAKI1,
NAVAJOWHITE1,
GREY22,
LIGHTSTEELBLUE1,
LIGHTSTEELBLUE2,
YELLOW3,
DARKOLIVEGREEN3,
DARKSEAGREEN5,
DARKSEAGREEN6,
LIGHTCYAN1,
LIGHTSKYBLUE3,
GREENYELLOW1,
DARKOLIVEGREEN4,
PALEGREEN4,
DARKSEAGREEN7,
DARKSEAGREEN8,
PALETURQUOISE2,
RED2,
DEEPPINK4,
DEEPPINK5,
MAGENTA2,
MAGENTA3,
MAGENTA4,
DARKORANGE2,
INDIANRED2,
HOTPINK2,
HOTPINK3,
ORCHID1,
MEDIUMORCHID3,
ORANGE3,
LIGHTSALMON2,
LIGHTPINK2,
PINK1,
PLUM2,
VIOLET1,
GOLD2,
LIGHTGOLDENROD1,
TAN1,
MISTYROSE1,
THISTLE1,
PLUM3,
YELLOW4,
KHAKI1,
LIGHTGOLDENROD2,
LIGHTYELLOW1,
GREY27,
LIGHTSTEELBLUE3,
YELLOW5,
DARKOLIVEGREEN5,
DARKOLIVEGREEN6,
DARKSEAGREEN9,
HONEYDEW1,
LIGHTCYAN2,
RED3,
DEEPPINK6,
DEEPPINK7,
DEEPPINK8,
MAGENTA5,
MAGENTA6,
ORANGERED1,
INDIANRED3,
INDIANRED4,
HOTPINK4,
HOTPINK5,
MEDIUMORCHID4,
DARKORANGE3,
SALMON1,
LIGHTCORAL1,
PALEVIOLETRED1,
ORCHID2,
ORCHID3,
ORANGE4,
SANDYBROWN1,
LIGHTSALMON3,
LIGHTPINK3,
PINK2,
PLUM4,
GOLD3,
LIGHTGOLDENROD3,
LIGHTGOLDENROD4,
NAVAJOWHITE2,
MISTYROSE2,
THISTLE2,
YELLOW6,
LIGHTGOLDENROD5,
KHAKI2,
WHEAT2,
CORNSILK1,
GREY31,
GREY2,
GREY3,
GREY4,
GREY5,
GREY6,
GREY7,
GREY8,
GREY9,
GREY10,
GREY12,
GREY13,
GREY14,
GREY15,
GREY17,
GREY18,
GREY19,
GREY21,
GREY23,
GREY24,
GREY25,
GREY26,
GREY28,
GREY29,
GREY30
};
internal static Color FromRgb(int rgb, int colorSet = 256)
=> FromRgb((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF, colorSet);
internal static Color FromRgb(int r, int g, int b, int colorSet = 256)
{
Color best = COLORS[0];
int cr = (best.Rgb >> 16) & 0xFF, cg = (best.Rgb >> 8) & 0xFF, cb = best.Rgb & 0xFF;
var bestDistance = Math.Sqrt((cr - r) * (cr - r) + (cg - g) * (cg - g) + (cb - b) * (cb - b));
var colors = COLORS.Take(Math.Min(colorSet, COLORS.Length)).ToArray();
for (int i = 1; i < colors.Length; i++)
{
cr = (colors[i].Rgb >> 16) & 0xFF;
cg = (colors[i].Rgb >> 8) & 0xFF;
cb = colors[i].Rgb & 0xFF;
var distance = Math.Sqrt((cr - r) * (cr - r) + (cg - g) * (cg - g) + (cb - b) * (cb - b));
if (distance < bestDistance)
{
bestDistance = distance;
best = colors[i];
}
}
return best;
}
internal static Color FromHsl(double h, double s, double l, int colorSet = 256)
{
byte r, g, b;
if (s == 0)
{
r = (byte)Math.Round(l * 255d);
g = (byte)Math.Round(l * 255d);
b = (byte)Math.Round(l * 255d);
}
else
{
double t1, t2;
double th = h / 6.0d;
if (l < 0.5d)
{
t2 = l * (1d + s);
}
else
{
t2 = (l + s) - (l * s);
}
t1 = 2d * l - t2;
double tr, tg, tb;
tr = th + (1.0d / 3.0d);
tg = th;
tb = th - (1.0d / 3.0d);
tr = ColorCalc(tr, t1, t2);
tg = ColorCalc(tg, t1, t2);
tb = ColorCalc(tb, t1, t2);
r = (byte)Math.Round(tr * 255d);
g = (byte)Math.Round(tg * 255d);
b = (byte)Math.Round(tb * 255d);
}
return FromRgb(r, g, b, colorSet);
}
private static double ColorCalc(double c, double t1, double t2)
{
if (c < 0) c += 1d;
if (c > 1) c -= 1d;
if (6.0d * c < 1.0d) return t1 + (t2 - t1) * 6.0d * c;
if (2.0d * c < 1.0d) return t2;
if (3.0d * c < 2.0d) return t1 + (t2 - t1) * (2.0d / 3.0d - c) * 6.0d;
return t1;
}
}