-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
ColorExtensions.swift
1804 lines (1271 loc) · 54.3 KB
/
ColorExtensions.swift
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// ColorExtensions.swift
// SwifterSwift-iOS
//
// Created by Omar Albeik on 9/27/17.
// Copyright © 2017 SwifterSwift
//
#if canImport(UIKit)
import UIKit
public typealias Color = UIColor
#endif
#if canImport(Cocoa)
import Cocoa
public typealias Color = NSColor
#endif
#if !os(watchOS)
import CoreImage
#endif
#if !os(Linux)
// MARK: - Properties
public extension Color {
/// SwifterSwift: Random color.
public static var random: Color {
let red = Int(arc4random_uniform(255))
let green = Int(arc4random_uniform(255))
let blue = Int(arc4random_uniform(255))
return Color(red: red, green: green, blue: blue)!
}
// swiftlint:disable next large_tuple
/// SwifterSwift: RGB components for a Color (between 0 and 255).
///
/// UIColor.red.rgbComponents.red -> 255
/// NSColor.green.rgbComponents.green -> 255
/// UIColor.blue.rgbComponents.blue -> 255
///
public var rgbComponents: (red: Int, green: Int, blue: Int) {
var components: [CGFloat] {
let comps = cgColor.components!
if comps.count == 4 { return comps }
return [comps[0], comps[0], comps[0], comps[1]]
}
let red = components[0]
let green = components[1]
let blue = components[2]
return (red: Int(red * 255.0), green: Int(green * 255.0), blue: Int(blue * 255.0))
}
// swiftlint:disable next large_tuple
/// SwifterSwift: RGB components for a Color represented as CGFloat numbers (between 0 and 1)
///
/// UIColor.red.rgbComponents.red -> 1.0
/// NSColor.green.rgbComponents.green -> 1.0
/// UIColor.blue.rgbComponents.blue -> 1.0
///
public var cgFloatComponents: (red: CGFloat, green: CGFloat, blue: CGFloat) {
var components: [CGFloat] {
let comps = cgColor.components!
if comps.count == 4 { return comps }
return [comps[0], comps[0], comps[0], comps[1]]
}
let red = components[0]
let green = components[1]
let blue = components[2]
return (red: red, green: green, blue: blue)
}
// swiftlint:disable next large_tuple
/// SwifterSwift: Get components of hue, saturation, and brightness, and alpha (read-only).
public var hsbaComponents: (hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat) {
var hue: CGFloat = 0.0
var saturation: CGFloat = 0.0
var brightness: CGFloat = 0.0
var alpha: CGFloat = 0.0
getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha)
return (hue: hue, saturation: saturation, brightness: brightness, alpha: alpha)
}
/// SwifterSwift: Hexadecimal value string (read-only).
public var hexString: String {
let components: [Int] = {
let comps = cgColor.components!
let components = comps.count == 4 ? comps : [comps[0], comps[0], comps[0], comps[1]]
return components.map { Int($0 * 255.0) }
}()
return String(format: "#%02X%02X%02X", components[0], components[1], components[2])
}
/// SwifterSwift: Short hexadecimal value string (read-only, if applicable).
public var shortHexString: String? {
let string = hexString.replacingOccurrences(of: "#", with: "")
let chrs = Array(string)
guard chrs[0] == chrs[1], chrs[2] == chrs[3], chrs[4] == chrs[5] else { return nil }
return "#\(chrs[0])\(chrs[2])\(chrs[4])"
}
/// SwifterSwift: Short hexadecimal value string, or full hexadecimal string if not possible (read-only).
public var shortHexOrHexString: String {
let components: [Int] = {
let comps = cgColor.components!
let components = comps.count == 4 ? comps : [comps[0], comps[0], comps[0], comps[1]]
return components.map { Int($0 * 255.0) }
}()
let hexString = String(format: "#%02X%02X%02X", components[0], components[1], components[2])
let string = hexString.replacingOccurrences(of: "#", with: "")
let chrs = Array(string)
guard chrs[0] == chrs[1], chrs[2] == chrs[3], chrs[4] == chrs[5] else { return hexString }
return "#\(chrs[0])\(chrs[2])\(chrs[4])"
}
/// SwifterSwift: Alpha of Color (read-only).
public var alpha: CGFloat {
return cgColor.alpha
}
#if !os(watchOS)
/// SwifterSwift: CoreImage.CIColor (read-only)
public var coreImageColor: CoreImage.CIColor? {
return CoreImage.CIColor(color: self)
}
#endif
/// SwifterSwift: Get UInt representation of a Color (read-only).
public var uInt: UInt {
let comps: [CGFloat] = {
let comps = cgColor.components!
return comps.count == 4 ? comps : [comps[0], comps[0], comps[0], comps[1]]
}()
var colorAsUInt32: UInt32 = 0
colorAsUInt32 += UInt32(comps[0] * 255.0) << 16
colorAsUInt32 += UInt32(comps[1] * 255.0) << 8
colorAsUInt32 += UInt32(comps[2] * 255.0)
return UInt(colorAsUInt32)
}
/// SwifterSwift: Get color complementary (read-only, if applicable).
public var complementary: Color? {
let colorSpaceRGB = CGColorSpaceCreateDeviceRGB()
let convertColorToRGBSpace: ((_ color: Color) -> Color?) = { color -> Color? in
if self.cgColor.colorSpace!.model == CGColorSpaceModel.monochrome {
let oldComponents = self.cgColor.components
let components: [CGFloat] = [ oldComponents![0], oldComponents![0], oldComponents![0], oldComponents![1]]
let colorRef = CGColor(colorSpace: colorSpaceRGB, components: components)
let colorOut = Color(cgColor: colorRef!)
return colorOut
} else {
return self
}
}
let color = convertColorToRGBSpace(self)
guard let componentColors = color?.cgColor.components else { return nil }
let red: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[0]*255), 2.0))/255
let green: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[1]*255), 2.0))/255
let blue: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[2]*255), 2.0))/255
return Color(red: red, green: green, blue: blue, alpha: 1.0)
}
}
// MARK: - Methods
public extension Color {
/// SwifterSwift: Blend two Colors
///
/// - Parameters:
/// - color1: first color to blend
/// - intensity1: intensity of first color (default is 0.5)
/// - color2: second color to blend
/// - intensity2: intensity of second color (default is 0.5)
/// - Returns: Color created by blending first and seond colors.
public static func blend(_ color1: Color, intensity1: CGFloat = 0.5, with color2: Color, intensity2: CGFloat = 0.5) -> Color {
// http://stackoverflow.com/questions/27342715/blend-uicolors-in-swift
let total = intensity1 + intensity2
let level1 = intensity1/total
let level2 = intensity2/total
guard level1 > 0 else { return color2 }
guard level2 > 0 else { return color1 }
let components1: [CGFloat] = {
let comps = color1.cgColor.components!
return comps.count == 4 ? comps : [comps[0], comps[0], comps[0], comps[1]]
}()
let components2: [CGFloat] = {
let comps = color2.cgColor.components!
return comps.count == 4 ? comps : [comps[0], comps[0], comps[0], comps[1]]
}()
let red1 = components1[0]
let red2 = components2[0]
let green1 = components1[1]
let green2 = components2[1]
let blue1 = components1[2]
let blue2 = components2[2]
let alpha1 = color1.cgColor.alpha
let alpha2 = color2.cgColor.alpha
let red = level1*red1 + level2*red2
let green = level1*green1 + level2*green2
let blue = level1*blue1 + level2*blue2
let alpha = level1*alpha1 + level2*alpha2
return Color(red: red, green: green, blue: blue, alpha: alpha)
}
/// SwifterSwift: Lighten a color
///
/// let color = Color(red: r, green: g, blue: b, alpha: a)
/// let lighterColor: Color = color.lighten(by: 0.2)
///
/// - Parameter percentage: Percentage by which to lighten the color
/// - Returns: A lightened color
public func lighten(by percentage: CGFloat = 0.2) -> Color {
// https://stackoverflow.com/questions/38435308/swift-get-lighter-and-darker-color-variations-for-a-given-uicolor
var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0
self.getRed(&red, green: &green, blue: &blue, alpha: &alpha)
return Color(red: min(red + percentage, 1.0),
green: min(green + percentage, 1.0),
blue: min(blue + percentage, 1.0),
alpha: alpha)
}
/// SwifterSwift: Darken a color
///
/// let color = Color(red: r, green: g, blue: b, alpha: a)
/// let darkerColor: Color = color.darken(by: 0.2)
///
/// - Parameter percentage: Percentage by which to darken the color
/// - Returns: A darkened color
public func darken(by percentage: CGFloat = 0.2) -> Color {
// https://stackoverflow.com/questions/38435308/swift-get-lighter-and-darker-color-variations-for-a-given-uicolor
var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0
self.getRed(&red, green: &green, blue: &blue, alpha: &alpha)
return Color(red: max(red - percentage, 0),
green: max(green - percentage, 0),
blue: max(blue - percentage, 0),
alpha: alpha)
}
}
// MARK: - Initializers
public extension Color {
/// SwifterSwift: Create Color from RGB values with optional transparency.
///
/// - Parameters:
/// - red: red component.
/// - green: green component.
/// - blue: blue component.
/// - transparency: optional transparency value (default is 1).
public convenience init?(red: Int, green: Int, blue: Int, transparency: CGFloat = 1) {
guard red >= 0 && red <= 255 else { return nil }
guard green >= 0 && green <= 255 else { return nil }
guard blue >= 0 && blue <= 255 else { return nil }
var trans = transparency
if trans < 0 { trans = 0 }
if trans > 1 { trans = 1 }
self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: trans)
}
/// SwifterSwift: Create Color from hexadecimal value with optional transparency.
///
/// - Parameters:
/// - hex: hex Int (example: 0xDECEB5).
/// - transparency: optional transparency value (default is 1).
public convenience init?(hex: Int, transparency: CGFloat = 1) {
var trans = transparency
if trans < 0 { trans = 0 }
if trans > 1 { trans = 1 }
let red = (hex >> 16) & 0xff
let green = (hex >> 8) & 0xff
let blue = hex & 0xff
self.init(red: red, green: green, blue: blue, transparency: trans)
}
/// SwifterSwift: Create Color from hexadecimal string with optional transparency (if applicable).
///
/// - Parameters:
/// - hexString: hexadecimal string (examples: EDE7F6, 0xEDE7F6, #EDE7F6, #0ff, 0xF0F, ..).
/// - transparency: optional transparency value (default is 1).
public convenience init?(hexString: String, transparency: CGFloat = 1) {
var string = ""
if hexString.lowercased().hasPrefix("0x") {
string = hexString.replacingOccurrences(of: "0x", with: "")
} else if hexString.hasPrefix("#") {
string = hexString.replacingOccurrences(of: "#", with: "")
} else {
string = hexString
}
if string.count == 3 { // convert hex to 6 digit format if in short format
var str = ""
string.forEach { str.append(String(repeating: String($0), count: 2)) }
string = str
}
guard let hexValue = Int(string, radix: 16) else { return nil }
var trans = transparency
if trans < 0 { trans = 0 }
if trans > 1 { trans = 1 }
let red = (hexValue >> 16) & 0xff
let green = (hexValue >> 8) & 0xff
let blue = hexValue & 0xff
self.init(red: red, green: green, blue: blue, transparency: trans)
}
/// SwifterSwift: Create Color from a complementary of a Color (if applicable).
///
/// - Parameter color: color of which opposite color is desired.
public convenience init?(complementaryFor color: Color) {
let colorSpaceRGB = CGColorSpaceCreateDeviceRGB()
let convertColorToRGBSpace: ((_ color: Color) -> Color?) = { color -> Color? in
if color.cgColor.colorSpace!.model == CGColorSpaceModel.monochrome {
let oldComponents = color.cgColor.components
let components: [CGFloat] = [ oldComponents![0], oldComponents![0], oldComponents![0], oldComponents![1]]
let colorRef = CGColor(colorSpace: colorSpaceRGB, components: components)
let colorOut = Color(cgColor: colorRef!)
return colorOut
} else {
return color
}
}
let color = convertColorToRGBSpace(color)
guard let componentColors = color?.cgColor.components else { return nil }
let red: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[0]*255), 2.0))/255
let green: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[1]*255), 2.0))/255
let blue: CGFloat = sqrt(pow(255.0, 2.0) - pow((componentColors[2]*255), 2.0))/255
self.init(red: red, green: green, blue: blue, alpha: 1.0)
}
}
// swiftlint:disable next type_body_length
// MARK: - Social
public extension Color {
/// SwifterSwift: Brand identity color of popular social media platform.
public struct Social {
// https://www.lockedowndesign.com/social-media-colors/
/// red: 59, green: 89, blue: 152
public static let facebook = Color(red: 59, green: 89, blue: 152)!
/// red: 0, green: 182, blue: 241
public static let twitter = Color(red: 0, green: 182, blue: 241)!
/// red: 223, green: 74, blue: 50
public static let googlePlus = Color(red: 223, green: 74, blue: 50)!
/// red: 0, green: 123, blue: 182
public static let linkedIn = Color(red: 0, green: 123, blue: 182)!
/// red: 69, green: 187, blue: 255
public static let vimeo = Color(red: 69, green: 187, blue: 255)!
/// red: 179, green: 18, blue: 23
public static let youtube = Color(red: 179, green: 18, blue: 23)!
/// red: 195, green: 42, blue: 163
public static let instagram = Color(red: 195, green: 42, blue: 163)!
/// red: 203, green: 32, blue: 39
public static let pinterest = Color(red: 203, green: 32, blue: 39)!
/// red: 244, green: 0, blue: 131
public static let flickr = Color(red: 244, green: 0, blue: 131)!
/// red: 67, green: 2, blue: 151
public static let yahoo = Color(red: 67, green: 2, blue: 151)!
/// red: 67, green: 2, blue: 151
public static let soundCloud = Color(red: 67, green: 2, blue: 151)!
/// red: 44, green: 71, blue: 98
public static let tumblr = Color(red: 44, green: 71, blue: 98)!
/// red: 252, green: 69, blue: 117
public static let foursquare = Color(red: 252, green: 69, blue: 117)!
/// red: 255, green: 176, blue: 0
public static let swarm = Color(red: 255, green: 176, blue: 0)!
/// red: 234, green: 76, blue: 137
public static let dribbble = Color(red: 234, green: 76, blue: 137)!
/// red: 255, green: 87, blue: 0
public static let reddit = Color(red: 255, green: 87, blue: 0)!
/// red: 74, green: 93, blue: 78
public static let devianArt = Color(red: 74, green: 93, blue: 78)!
/// red: 238, green: 64, blue: 86
public static let pocket = Color(red: 238, green: 64, blue: 86)!
/// red: 170, green: 34, blue: 182
public static let quora = Color(red: 170, green: 34, blue: 182)!
/// red: 247, green: 146, blue: 30
public static let slideShare = Color(red: 247, green: 146, blue: 30)!
/// red: 0, green: 153, blue: 229
public static let px500 = Color(red: 0, green: 153, blue: 229)!
/// red: 223, green: 109, blue: 70
public static let listly = Color(red: 223, green: 109, blue: 70)!
/// red: 0, green: 180, blue: 137
public static let vine = Color(red: 0, green: 180, blue: 137)!
/// red: 0, green: 175, blue: 240
public static let skype = Color(red: 0, green: 175, blue: 240)!
/// red: 235, green: 73, blue: 36
public static let stumbleUpon = Color(red: 235, green: 73, blue: 36)!
/// red: 255, green: 252, blue: 0
public static let snapchat = Color(red: 255, green: 252, blue: 0)!
}
}
// MARK: - Material colors
public extension Color {
/// SwifterSwift: Google Material design colors palette.
public struct Material {
// https://material.google.com/style/color.html
/// SwifterSwift: color red500
public static let red = red500
/// SwifterSwift: hex #FFEBEE
public static let red50 = Color(hex: 0xFFEBEE)!
/// SwifterSwift: hex #FFCDD2
public static let red100 = Color(hex: 0xFFCDD2)!
/// SwifterSwift: hex #EF9A9A
public static let red200 = Color(hex: 0xEF9A9A)!
/// SwifterSwift: hex #E57373
public static let red300 = Color(hex: 0xE57373)!
/// SwifterSwift: hex #EF5350
public static let red400 = Color(hex: 0xEF5350)!
/// SwifterSwift: hex #F44336
public static let red500 = Color(hex: 0xF44336)!
/// SwifterSwift: hex #E53935
public static let red600 = Color(hex: 0xE53935)!
/// SwifterSwift: hex #D32F2F
public static let red700 = Color(hex: 0xD32F2F)!
/// SwifterSwift: hex #C62828
public static let red800 = Color(hex: 0xC62828)!
/// SwifterSwift: hex #B71C1C
public static let red900 = Color(hex: 0xB71C1C)!
/// SwifterSwift: hex #FF8A80
public static let redA100 = Color(hex: 0xFF8A80)!
/// SwifterSwift: hex #FF5252
public static let redA200 = Color(hex: 0xFF5252)!
/// SwifterSwift: hex #FF1744
public static let redA400 = Color(hex: 0xFF1744)!
/// SwifterSwift: hex #D50000
public static let redA700 = Color(hex: 0xD50000)!
/// SwifterSwift: color pink500
public static let pink = pink500
/// SwifterSwift: hex #FCE4EC
public static let pink50 = Color(hex: 0xFCE4EC)!
/// SwifterSwift: hex #F8BBD0
public static let pink100 = Color(hex: 0xF8BBD0)!
/// SwifterSwift: hex #F48FB1
public static let pink200 = Color(hex: 0xF48FB1)!
/// SwifterSwift: hex #F06292
public static let pink300 = Color(hex: 0xF06292)!
/// SwifterSwift: hex #EC407A
public static let pink400 = Color(hex: 0xEC407A)!
/// SwifterSwift: hex #E91E63
public static let pink500 = Color(hex: 0xE91E63)!
/// SwifterSwift: hex #D81B60
public static let pink600 = Color(hex: 0xD81B60)!
/// SwifterSwift: hex #C2185B
public static let pink700 = Color(hex: 0xC2185B)!
/// SwifterSwift: hex #AD1457
public static let pink800 = Color(hex: 0xAD1457)!
/// SwifterSwift: hex #880E4F
public static let pink900 = Color(hex: 0x880E4F)!
/// SwifterSwift: hex #FF80AB
public static let pinkA100 = Color(hex: 0xFF80AB)!
/// SwifterSwift: hex #FF4081
public static let pinkA200 = Color(hex: 0xFF4081)!
/// SwifterSwift: hex #F50057
public static let pinkA400 = Color(hex: 0xF50057)!
/// SwifterSwift: hex #C51162
public static let pinkA700 = Color(hex: 0xC51162)!
/// SwifterSwift: color purple500
public static let purple = purple500
/// SwifterSwift: hex #F3E5F5
public static let purple50 = Color(hex: 0xF3E5F5)!
/// SwifterSwift: hex #E1BEE7
public static let purple100 = Color(hex: 0xE1BEE7)!
/// SwifterSwift: hex #CE93D8
public static let purple200 = Color(hex: 0xCE93D8)!
/// SwifterSwift: hex #BA68C8
public static let purple300 = Color(hex: 0xBA68C8)!
/// SwifterSwift: hex #AB47BC
public static let purple400 = Color(hex: 0xAB47BC)!
/// SwifterSwift: hex #9C27B0
public static let purple500 = Color(hex: 0x9C27B0)!
/// SwifterSwift: hex #8E24AA
public static let purple600 = Color(hex: 0x8E24AA)!
/// SwifterSwift: hex #7B1FA2
public static let purple700 = Color(hex: 0x7B1FA2)!
/// SwifterSwift: hex #6A1B9A
public static let purple800 = Color(hex: 0x6A1B9A)!
/// SwifterSwift: hex #4A148C
public static let purple900 = Color(hex: 0x4A148C)!
/// SwifterSwift: hex #EA80FC
public static let purpleA100 = Color(hex: 0xEA80FC)!
/// SwifterSwift: hex #E040FB
public static let purpleA200 = Color(hex: 0xE040FB)!
/// SwifterSwift: hex #D500F9
public static let purpleA400 = Color(hex: 0xD500F9)!
/// SwifterSwift: hex #AA00FF
public static let purpleA700 = Color(hex: 0xAA00FF)!
/// SwifterSwift: color deepPurple500
public static let deepPurple = deepPurple500
/// SwifterSwift: hex #EDE7F6
public static let deepPurple50 = Color(hex: 0xEDE7F6)!
/// SwifterSwift: hex #D1C4E9
public static let deepPurple100 = Color(hex: 0xD1C4E9)!
/// SwifterSwift: hex #B39DDB
public static let deepPurple200 = Color(hex: 0xB39DDB)!
/// SwifterSwift: hex #9575CD
public static let deepPurple300 = Color(hex: 0x9575CD)!
/// SwifterSwift: hex #7E57C2
public static let deepPurple400 = Color(hex: 0x7E57C2)!
/// SwifterSwift: hex #673AB7
public static let deepPurple500 = Color(hex: 0x673AB7)!
/// SwifterSwift: hex #5E35B1
public static let deepPurple600 = Color(hex: 0x5E35B1)!
/// SwifterSwift: hex #512DA8
public static let deepPurple700 = Color(hex: 0x512DA8)!
/// SwifterSwift: hex #4527A0
public static let deepPurple800 = Color(hex: 0x4527A0)!
/// SwifterSwift: hex #311B92
public static let deepPurple900 = Color(hex: 0x311B92)!
/// SwifterSwift: hex #B388FF
public static let deepPurpleA100 = Color(hex: 0xB388FF)!
/// SwifterSwift: hex #7C4DFF
public static let deepPurpleA200 = Color(hex: 0x7C4DFF)!
/// SwifterSwift: hex #651FFF
public static let deepPurpleA400 = Color(hex: 0x651FFF)!
/// SwifterSwift: hex #6200EA
public static let deepPurpleA700 = Color(hex: 0x6200EA)!
/// SwifterSwift: color indigo500
public static let indigo = indigo500
/// SwifterSwift: hex #E8EAF6
public static let indigo50 = Color(hex: 0xE8EAF6)!
/// SwifterSwift: hex #C5CAE9
public static let indigo100 = Color(hex: 0xC5CAE9)!
/// SwifterSwift: hex #9FA8DA
public static let indigo200 = Color(hex: 0x9FA8DA)!
/// SwifterSwift: hex #7986CB
public static let indigo300 = Color(hex: 0x7986CB)!
/// SwifterSwift: hex #5C6BC0
public static let indigo400 = Color(hex: 0x5C6BC0)!
/// SwifterSwift: hex #3F51B5
public static let indigo500 = Color(hex: 0x3F51B5)!
/// SwifterSwift: hex #3949AB
public static let indigo600 = Color(hex: 0x3949AB)!
/// SwifterSwift: hex #303F9F
public static let indigo700 = Color(hex: 0x303F9F)!
/// SwifterSwift: hex #283593
public static let indigo800 = Color(hex: 0x283593)!
/// SwifterSwift: hex #1A237E
public static let indigo900 = Color(hex: 0x1A237E)!
/// SwifterSwift: hex #8C9EFF
public static let indigoA100 = Color(hex: 0x8C9EFF)!
/// SwifterSwift: hex #536DFE
public static let indigoA200 = Color(hex: 0x536DFE)!
/// SwifterSwift: hex #3D5AFE
public static let indigoA400 = Color(hex: 0x3D5AFE)!
/// SwifterSwift: hex #304FFE
public static let indigoA700 = Color(hex: 0x304FFE)!
/// SwifterSwift: color blue500
public static let blue = blue500
/// SwifterSwift: hex #E3F2FD
public static let blue50 = Color(hex: 0xE3F2FD)!
/// SwifterSwift: hex #BBDEFB
public static let blue100 = Color(hex: 0xBBDEFB)!
/// SwifterSwift: hex #90CAF9
public static let blue200 = Color(hex: 0x90CAF9)!
/// SwifterSwift: hex #64B5F6
public static let blue300 = Color(hex: 0x64B5F6)!
/// SwifterSwift: hex #42A5F5
public static let blue400 = Color(hex: 0x42A5F5)!
/// SwifterSwift: hex #2196F3
public static let blue500 = Color(hex: 0x2196F3)!
/// SwifterSwift: hex #1E88E5
public static let blue600 = Color(hex: 0x1E88E5)!
/// SwifterSwift: hex #1976D2
public static let blue700 = Color(hex: 0x1976D2)!
/// SwifterSwift: hex #1565C0
public static let blue800 = Color(hex: 0x1565C0)!
/// SwifterSwift: hex #0D47A1
public static let blue900 = Color(hex: 0x0D47A1)!
/// SwifterSwift: hex #82B1FF
public static let blueA100 = Color(hex: 0x82B1FF)!
/// SwifterSwift: hex #448AFF
public static let blueA200 = Color(hex: 0x448AFF)!
/// SwifterSwift: hex #2979FF
public static let blueA400 = Color(hex: 0x2979FF)!
/// SwifterSwift: hex #2962FF
public static let blueA700 = Color(hex: 0x2962FF)!
/// SwifterSwift: color lightBlue500
public static let lightBlue = lightBlue500
/// SwifterSwift: hex #E1F5FE
public static let lightBlue50 = Color(hex: 0xE1F5FE)!
/// SwifterSwift: hex #B3E5FC
public static let lightBlue100 = Color(hex: 0xB3E5FC)!
/// SwifterSwift: hex #81D4FA
public static let lightBlue200 = Color(hex: 0x81D4FA)!
/// SwifterSwift: hex #4FC3F7
public static let lightBlue300 = Color(hex: 0x4FC3F7)!
/// SwifterSwift: hex #29B6F6
public static let lightBlue400 = Color(hex: 0x29B6F6)!
/// SwifterSwift: hex #03A9F4
public static let lightBlue500 = Color(hex: 0x03A9F4)!
/// SwifterSwift: hex #039BE5
public static let lightBlue600 = Color(hex: 0x039BE5)!
/// SwifterSwift: hex #0288D1
public static let lightBlue700 = Color(hex: 0x0288D1)!
/// SwifterSwift: hex #0277BD
public static let lightBlue800 = Color(hex: 0x0277BD)!
/// SwifterSwift: hex #01579B
public static let lightBlue900 = Color(hex: 0x01579B)!
/// SwifterSwift: hex #80D8FF
public static let lightBlueA100 = Color(hex: 0x80D8FF)!
/// SwifterSwift: hex #40C4FF
public static let lightBlueA200 = Color(hex: 0x40C4FF)!
/// SwifterSwift: hex #00B0FF
public static let lightBlueA400 = Color(hex: 0x00B0FF)!
/// SwifterSwift: hex #0091EA
public static let lightBlueA700 = Color(hex: 0x0091EA)!
/// SwifterSwift: color cyan500
public static let cyan = cyan500
/// SwifterSwift: hex #E0F7FA
public static let cyan50 = Color(hex: 0xE0F7FA)!
/// SwifterSwift: hex #B2EBF2
public static let cyan100 = Color(hex: 0xB2EBF2)!
/// SwifterSwift: hex #80DEEA
public static let cyan200 = Color(hex: 0x80DEEA)!
/// SwifterSwift: hex #4DD0E1
public static let cyan300 = Color(hex: 0x4DD0E1)!
/// SwifterSwift: hex #26C6DA
public static let cyan400 = Color(hex: 0x26C6DA)!
/// SwifterSwift: hex #00BCD4
public static let cyan500 = Color(hex: 0x00BCD4)!
/// SwifterSwift: hex #00ACC1
public static let cyan600 = Color(hex: 0x00ACC1)!
/// SwifterSwift: hex #0097A7
public static let cyan700 = Color(hex: 0x0097A7)!
/// SwifterSwift: hex #00838F
public static let cyan800 = Color(hex: 0x00838F)!
/// SwifterSwift: hex #006064
public static let cyan900 = Color(hex: 0x006064)!
/// SwifterSwift: hex #84FFFF
public static let cyanA100 = Color(hex: 0x84FFFF)!
/// SwifterSwift: hex #18FFFF
public static let cyanA200 = Color(hex: 0x18FFFF)!
/// SwifterSwift: hex #00E5FF
public static let cyanA400 = Color(hex: 0x00E5FF)!
/// SwifterSwift: hex #00B8D4
public static let cyanA700 = Color(hex: 0x00B8D4)!
/// SwifterSwift: color teal500
public static let teal = teal500
/// SwifterSwift: hex #E0F2F1
public static let teal50 = Color(hex: 0xE0F2F1)!
/// SwifterSwift: hex #B2DFDB
public static let teal100 = Color(hex: 0xB2DFDB)!
/// SwifterSwift: hex #80CBC4
public static let teal200 = Color(hex: 0x80CBC4)!
/// SwifterSwift: hex #4DB6AC
public static let teal300 = Color(hex: 0x4DB6AC)!
/// SwifterSwift: hex #26A69A
public static let teal400 = Color(hex: 0x26A69A)!
/// SwifterSwift: hex #009688
public static let teal500 = Color(hex: 0x009688)!
/// SwifterSwift: hex #00897B
public static let teal600 = Color(hex: 0x00897B)!
/// SwifterSwift: hex #00796B
public static let teal700 = Color(hex: 0x00796B)!
/// SwifterSwift: hex #00695C
public static let teal800 = Color(hex: 0x00695C)!
/// SwifterSwift: hex #004D40
public static let teal900 = Color(hex: 0x004D40)!
/// SwifterSwift: hex #A7FFEB
public static let tealA100 = Color(hex: 0xA7FFEB)!
/// SwifterSwift: hex #64FFDA
public static let tealA200 = Color(hex: 0x64FFDA)!
/// SwifterSwift: hex #1DE9B6
public static let tealA400 = Color(hex: 0x1DE9B6)!
/// SwifterSwift: hex #00BFA5
public static let tealA700 = Color(hex: 0x00BFA5)!
/// SwifterSwift: color green500
public static let green = green500
/// SwifterSwift: hex #E8F5E9
public static let green50 = Color(hex: 0xE8F5E9)!
/// SwifterSwift: hex #C8E6C9
public static let green100 = Color(hex: 0xC8E6C9)!
/// SwifterSwift: hex #A5D6A7
public static let green200 = Color(hex: 0xA5D6A7)!
/// SwifterSwift: hex #81C784
public static let green300 = Color(hex: 0x81C784)!
/// SwifterSwift: hex #66BB6A
public static let green400 = Color(hex: 0x66BB6A)!
/// SwifterSwift: hex #4CAF50
public static let green500 = Color(hex: 0x4CAF50)!
/// SwifterSwift: hex #43A047
public static let green600 = Color(hex: 0x43A047)!
/// SwifterSwift: hex #388E3C
public static let green700 = Color(hex: 0x388E3C)!
/// SwifterSwift: hex #2E7D32
public static let green800 = Color(hex: 0x2E7D32)!
/// SwifterSwift: hex #1B5E20
public static let green900 = Color(hex: 0x1B5E20)!
/// SwifterSwift: hex #B9F6CA
public static let greenA100 = Color(hex: 0xB9F6CA)!
/// SwifterSwift: hex #69F0AE
public static let greenA200 = Color(hex: 0x69F0AE)!
/// SwifterSwift: hex #00E676
public static let greenA400 = Color(hex: 0x00E676)!
/// SwifterSwift: hex #00C853
public static let greenA700 = Color(hex: 0x00C853)!
/// SwifterSwift: color lightGreen500
public static let lightGreen = lightGreen500
/// SwifterSwift: hex #F1F8E9
public static let lightGreen50 = Color(hex: 0xF1F8E9)!
/// SwifterSwift: hex #DCEDC8
public static let lightGreen100 = Color(hex: 0xDCEDC8)!
/// SwifterSwift: hex #C5E1A5
public static let lightGreen200 = Color(hex: 0xC5E1A5)!
/// SwifterSwift: hex #AED581
public static let lightGreen300 = Color(hex: 0xAED581)!
/// SwifterSwift: hex #9CCC65
public static let lightGreen400 = Color(hex: 0x9CCC65)!
/// SwifterSwift: hex #8BC34A
public static let lightGreen500 = Color(hex: 0x8BC34A)!
/// SwifterSwift: hex #7CB342
public static let lightGreen600 = Color(hex: 0x7CB342)!
/// SwifterSwift: hex #689F38
public static let lightGreen700 = Color(hex: 0x689F38)!
/// SwifterSwift: hex #558B2F
public static let lightGreen800 = Color(hex: 0x558B2F)!
/// SwifterSwift: hex #33691E
public static let lightGreen900 = Color(hex: 0x33691E)!
/// SwifterSwift: hex #CCFF90
public static let lightGreenA100 = Color(hex: 0xCCFF90)!
/// SwifterSwift: hex #B2FF59
public static let lightGreenA200 = Color(hex: 0xB2FF59)!
/// SwifterSwift: hex #76FF03
public static let lightGreenA400 = Color(hex: 0x76FF03)!
/// SwifterSwift: hex #64DD17
public static let lightGreenA700 = Color(hex: 0x64DD17)!
/// SwifterSwift: color lime500
public static let lime = lime500
/// SwifterSwift: hex #F9FBE7
public static let lime50 = Color(hex: 0xF9FBE7)!
/// SwifterSwift: hex #F0F4C3
public static let lime100 = Color(hex: 0xF0F4C3)!
/// SwifterSwift: hex #E6EE9C
public static let lime200 = Color(hex: 0xE6EE9C)!
/// SwifterSwift: hex #DCE775
public static let lime300 = Color(hex: 0xDCE775)!
/// SwifterSwift: hex #D4E157
public static let lime400 = Color(hex: 0xD4E157)!
/// SwifterSwift: hex #CDDC39
public static let lime500 = Color(hex: 0xCDDC39)!
/// SwifterSwift: hex #C0CA33
public static let lime600 = Color(hex: 0xC0CA33)!
/// SwifterSwift: hex #AFB42B
public static let lime700 = Color(hex: 0xAFB42B)!
/// SwifterSwift: hex #9E9D24
public static let lime800 = Color(hex: 0x9E9D24)!
/// SwifterSwift: hex #827717
public static let lime900 = Color(hex: 0x827717)!
/// SwifterSwift: hex #F4FF81
public static let limeA100 = Color(hex: 0xF4FF81)!
/// SwifterSwift: hex #EEFF41
public static let limeA200 = Color(hex: 0xEEFF41)!
/// SwifterSwift: hex #C6FF00
public static let limeA400 = Color(hex: 0xC6FF00)!
/// SwifterSwift: hex #AEEA00
public static let limeA700 = Color(hex: 0xAEEA00)!
/// SwifterSwift: color yellow500
public static let yellow = yellow500
/// SwifterSwift: hex #FFFDE7
public static let yellow50 = Color(hex: 0xFFFDE7)!
/// SwifterSwift: hex #FFF9C4
public static let yellow100 = Color(hex: 0xFFF9C4)!