-
Notifications
You must be signed in to change notification settings - Fork 0
/
MNLColor.h
894 lines (653 loc) · 21.5 KB
/
MNLColor.h
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
#import <Foundation/Foundation.h>
#include <CoreGraphics/CGColor.h>
#ifdef __MNLCOLOR_API_REPLACEMENT
#undef __MNLCOLOR_API_REPLACEMENT
#endif
#define __MNLCOLOR_API_REPLACEMENT(rep) __attribute__((availability(macos, deprecated=10.0, replacement=#rep))) __attribute__((availability(ios, deprecated=2.0, replacement=#rep))) __attribute__((availability(watchos, deprecated=2.0, replacement=#rep))) __attribute__((availability(tvos, deprecated=9.0, replacement=#rep))) __attribute__((availability(macCatalyst, deprecated=13.0, replacement=#rep)))
/// @brief
/// A profile that specifies how to interpret a color value for display.
typedef NS_CLOSED_ENUM(NSInteger, MNLColorSpace) {
// 10.0 ////////////////////////////////////////////////////////////////
/// @brief
/// A device-dependent gray color space.
MNLColorSpaceDeviceGray NS_SWIFT_NAME(deviceGray) = NSIntegerMin,
/// @brief
/// A device-dependent RGB color space.
MNLColorSpaceDeviceRGB NS_SWIFT_NAME(deviceRGB),
/// @brief
/// A device-dependent CMYK color space.
MNLColorSpaceDeviceCMYK NS_SWIFT_NAME(deviceCMYK),
// * ///////////////////////////////////////////////////////////////////
/// @brief
/// An unknown color space.
MNLColorSpaceUnknown NS_SWIFT_NAME(unknown) = ~0,
// 10.4 ////////////////////////////////////////////////////////////////
/// @brief
/// The generic gray color space.
MNLColorSpaceGenericGray NS_SWIFT_NAME(gray),
/// @brief
/// The generic RGB color space.
MNLColorSpaceGenericRGB NS_SWIFT_NAME(rgb),
/// @brief
/// The generic CMYK color space.
MNLColorSpaceGenericCMYK NS_SWIFT_NAME(cmyk),
// 10.5 ////////////////////////////////////////////////////////////////
/// @brief
/// The generic RGB color space with a linear transfer function.
MNLColorSpaceGenericRGBLinear NS_SWIFT_NAME(rgbLinear),
/// @brief
/// The Adobe RGB (1998) color space.
MNLColorSpaceAdobeRGB1998 NS_SWIFT_NAME(adobeRGB),
/// @brief
/// The standard Red Green Blue (sRGB) color space.
MNLColorSpaceSRGB NS_SWIFT_NAME(sRGB),
// 10.6 ////////////////////////////////////////////////////////////////
/// @brief
/// The generic gray color space that has an exponential transfer
/// function with a power of 2.2.
MNLColorSpaceGenericGrayGamma2_2 NS_SWIFT_NAME(genericGrayGamma22),
// 10.11 ///////////////////////////////////////////////////////////////
/// @brief
/// The XYZ color space, as defined by the CIE 1931 standard.
MNLColorSpaceGenericXYZ NS_SWIFT_NAME(genericXYZ),
/// @brief
/// The ACEScg color space.
MNLColorSpaceACESCGLinear NS_SWIFT_NAME(asescgLinear),
/// @brief
/// The recommendation of the International Telecommunication Union
/// (ITU) Radiocommunication sector for the BT.709 color space.
MNLColorSpaceITUR_709 NS_SWIFT_NAME(itur709),
/// @brief
/// The recommendation of the International Telecommunication Union
/// (ITU) Radiocommunication sector for the BT.2020 color space.
MNLColorSpaceITUR_2020 NS_SWIFT_NAME(itur2020),
/// @brief
/// The Reference Output Medium Metric (ROMM) RGB color space.
MNLColorSpaceROMMRGB NS_SWIFT_NAME(rommRGB),
/// @brief
/// The DCI P3 color space, which is the digital cinema standard.
MNLColorSpaceDCIP3 NS_SWIFT_NAME(dciP3),
// 10.11.2 /////////////////////////////////////////////////////////////
/// @brief
/// The Display P3 color space, created by Apple.
MNLColorSpaceDisplayP3 NS_SWIFT_NAME(displayP3),
// 10.12 ///////////////////////////////////////////////////////////////
/// @brief
/// The gray color space using a linear transfer function.
MNLColorSpaceLinearGray NS_SWIFT_NAME(linearGray),
/// @brief
/// The extended sRGB color space.
MNLColorSpaceExtendedSRGB NS_SWIFT_NAME(extendedSRGB),
/// @brief
/// The sRGB color space with a linear transfer function.
MNLColorSpaceLinearSRGB NS_SWIFT_NAME(linearSRGB),
/// @brief
/// The sRGB color space with a linear transfer function and
/// extended-range values.
MNLColorSpaceExtendedLinearSRGB NS_SWIFT_NAME(extendedLinearSRGB),
/// @brief
/// The extended gray color space.
MNLColorSpaceExtendedGray NS_SWIFT_NAME(extendedGray),
/// @brief
/// The extended gray color space with a linear transfer function.
MNLColorSpaceExtendedLinearGray NS_SWIFT_NAME(extendedLinearGray),
// 10.14.3 /////////////////////////////////////////////////////////////
/// @brief
/// The Display P3 color space with a linear transfer function and
/// extended-range values.
MNLColorSpaceExtendedLinearDisplayP3 NS_SWIFT_NAME(extendedLineaarDisplayP3),
/// @brief
/// The recommendation of the International Telecommunication Union
/// (ITU) Radiocommunication sector for the BT.2020 color space,
/// with a linear transfer function and extended range values.
MNLColorSpaceExtendedLinearITUR_2020 NS_SWIFT_NAME(extendedLinearITUR2020),
// 10.14.6 /////////////////////////////////////////////////////////////
/// @brief
/// The Display P3 color space, using the PQ transfer function.
MNLColorSpaceDisplayP3_PQ_EOTF NS_SWIFT_NAME(displayP3PQEOTF) API_AVAILABLE(macCatalyst(13.0)) API_DEPRECATED("No longer supported", macos(10.14.6, 10.15.4), ios(13.0, 13.4), tvos(13.0, 13.4), watchos(6.0, 6.2)),
/// @brief
/// The Display P3 color space, using the HLG transfer function.
MNLColorSpaceDisplayP3_HLG NS_SWIFT_NAME(displayP3HLG),
/// @brief
/// The recommendation of the International Telecommunication Union
/// (ITU) Radiocommunication sector for the BT.2020 color space,
/// with the PQ transfer function.
MNLColorSpaceITUR_2020_PQ_EOTF NS_SWIFT_NAME(itur2020PQEOTF) API_AVAILABLE(macCatalyst(13.0)) API_DEPRECATED("No longer supported", macos(10.14.6, 10.15.4), ios(13.0, 13.4), tvos(13.0, 13.4), watchos(6.0, 6.2)),
/// @brief
/// The recommendation of the International Telecommunication Union
/// (ITU) Radiocommunication sector for the BT.2020 color space,
/// with the HLG transfer function.
MNLColorSpaceITUR_2020_HLG NS_SWIFT_NAME(itur2020HLG),
};
typedef NS_CLOSED_ENUM(NSInteger, MNLColorRenderingIntent) {
MNLColorRenderingIntentDefault,
MNLColorRenderingIntentAbsoluteColorimetric,
MNLColorRenderingIntentRelativeColorimetric,
MNLColorRenderingIntentPerceptual,
MNLColorRenderingIntentSaturation,
};
typedef struct {
CGFloat white;
CGFloat alpha;
} MNLMonochromeColorComponents;
typedef struct {
CGFloat red;
CGFloat green;
CGFloat blue;
CGFloat alpha;
} MNLRGBColorComponents;
typedef struct {
CGFloat cyan;
CGFloat magenta;
CGFloat yellow;
CGFloat black;
CGFloat alpha;
} MNLCMYKColorComponents;
@class MNLColorPalette;
#pragma mark -
@interface
MNLColor : NSObject
<NSCopying, NSSecureCoding>
@property (class, nonatomic)
MNLColorSpace defaultMonochromeColorSpace;
@property (class, nonatomic)
MNLColorSpace defaultRGBColorSpace;
@property (class, nonatomic)
MNLColorSpace defaultCMYKColorSpace;
@property (class, nonatomic, readonly, nonnull)
MNLColor *clearColor;
+ (instancetype _Nonnull)
new
NS_UNAVAILABLE;
+ (MNLColor *_Nullable)
colorWithWhite:(CGFloat)white
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithWhite:(CGFloat)white
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithWhite:(CGFloat)white
alpha:(CGFloat)alpha;
+ (MNLColor *_Nullable)
colorWithWhite:(CGFloat)white;
+ (MNLColor *_Nullable)
colorWithHexadecimalWhite:(NSInteger)white
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalWhite:(NSInteger)white
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalWhite:(NSInteger)white
alpha:(CGFloat)alpha
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalWhite:(NSInteger)white
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
alpha:(CGFloat)alpha;
+ (MNLColor *_Nullable)
colorWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue;
+ (MNLColor *_Nullable)
colorWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
alpha:(CGFloat)alpha
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
NS_REFINED_FOR_SWIFT;
+ (MNLColor *_Nullable)
colorWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
colorSpace:(MNLColorSpace)colorSpace;
+ (MNLColor *_Nullable)
colorWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
alpha:(CGFloat)alpha;
+ (MNLColor *_Nullable)
colorWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black;
+ (MNLColor *_Nonnull)
colorWithCGColor:(CGColorRef _Nonnull)cgColor;
+ (MNLColor *_Nonnull)
colorWithColor:(MNLColor *_Nonnull)color;
@property (nonatomic, readonly, nonnull)
CGColorRef CGColor;
@property (nonatomic, readonly)
BOOL isMonochrome;
@property (nonatomic, readonly)
BOOL isRGB;
@property (nonatomic, readonly)
BOOL isCMYK;
@property (readonly)
MNLColorSpace colorSpace;
@property (readonly)
NSUInteger numberOfComponents;
- (instancetype _Nonnull)
init
NS_UNAVAILABLE;
- (instancetype _Nullable)
initWithWhite:(CGFloat)white
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithWhite:(CGFloat)white
colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithWhite:(CGFloat)white
alpha:(CGFloat)alpha;
- (instancetype _Nullable)
initWithWhite:(CGFloat)white;
- (instancetype _Nullable)
initWithHexadecimalWhite:(NSInteger)white
alpha:(CGFloat)alpha colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalWhite:(NSInteger)white
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalWhite:(NSInteger)white
alpha:(CGFloat)alpha
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalWhite:(NSInteger)white
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
alpha:(CGFloat)alpha colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue
alpha:(CGFloat)alpha;
- (instancetype _Nullable)
initWithRed:(CGFloat)red
green:(CGFloat)green
blue:(CGFloat)blue;
- (instancetype _Nullable)
initWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
colorSpace:(MNLColorSpace)colorSpace
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
alpha:(CGFloat)alpha
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithHexadecimalRed:(NSInteger)red
green:(NSInteger)green
blue:(NSInteger)blue
NS_REFINED_FOR_SWIFT;
- (instancetype _Nullable)
initWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
alpha:(CGFloat)alpha
colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
colorSpace:(MNLColorSpace)colorSpace;
- (instancetype _Nullable)
initWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black
alpha:(CGFloat)alpha;
- (instancetype _Nullable)
initWithCyan:(CGFloat)cyan
magenta:(CGFloat)magenta
yellow:(CGFloat)yellow
black:(CGFloat)black;
- (instancetype _Nullable)
initWithColorSpace:(MNLColorSpace)colorSpace,
...;
- (instancetype _Nonnull)
initWithCGColor:(CGColorRef _Nonnull)cgColor;
- (BOOL)
monochromeColorComponents:(MNLMonochromeColorComponents *_Nonnull)components
__MNLCOLOR_API_REPLACEMENT(-getMonochromeColorComponents:);
- (BOOL)
RGBColorComponents:(MNLRGBColorComponents *_Nonnull)components
__MNLCOLOR_API_REPLACEMENT(-getRGBColorComponents:);
- (BOOL)
CMYKColorComponents:(MNLCMYKColorComponents *_Nonnull)components
__MNLCOLOR_API_REPLACEMENT(-getCMYKColorComponents:);
- (instancetype _Nonnull)
colorWithAlpha:(CGFloat)alpha
NS_SWIFT_NAME(color(alpha:));
- (instancetype _Nullable)
colorWithColorSpace:(MNLColorSpace)colorSpace
renderingIntent:(MNLColorRenderingIntent)renderingIntent
NS_SWIFT_NAME(color(colorSpace:renderingIntent:));
- (void)
getMonochromeColorComponents:(MNLMonochromeColorComponents *_Nonnull)components
NS_REFINED_FOR_SWIFT;
- (void)
getRGBColorComponents:(MNLRGBColorComponents *_Nonnull)components
NS_REFINED_FOR_SWIFT;
- (void)
getCMYKColorComponents:(MNLCMYKColorComponents *_Nonnull)components
NS_REFINED_FOR_SWIFT;
- (void)
getColorComponents:(CGFloat *_Nonnull)components
NS_REFINED_FOR_SWIFT;
@end
#pragma mark -
#if !TARGET_OS_WATCH
#import <CoreImage/CIColor.h>
@interface
MNLColor (CIColor)
+ (MNLColor *_Nonnull)
colorWithCIColor:(CIColor *_Nonnull)ciColor;
@property (nonatomic, readonly, nonnull)
CIColor *CIColor;
- (instancetype _Nonnull)
initWithCIColor:(CIColor *_Nonnull)ciColor;
@end
#endif
#if TARGET_OS_IPHONE // TARGET_OS_IOS | TARGET_OS_TV | TARGET_OS_WATCH
#pragma mark -
#import <UIKit/UIColor.h>
@interface
MNLColor (UIColor)
+ (MNLColor *_Nonnull)
colorWithUIColor:(UIColor *_Nonnull)uiColor;
@property (nonatomic, readonly, nonnull)
UIColor *UIColor;
- (instancetype _Nonnull)
initWithUIColor:(UIColor *_Nonnull)uiColor;
@end
#endif
#if TARGET_OS_OSX
#pragma mark -
#import <AppKit/NSColor.h>
@interface
MNLColor (NSColor)
+ (MNLColor *_Nonnull)
colorWithNSColor:(NSColor *_Nonnull)nsColor;
@property (nonatomic, readonly, nonnull)
NSColor *NSColor;
- (instancetype _Nonnull)
initWithNSColor:(NSColor *_Nonnull)nsColor;
@end
#endif
#pragma mark -
/// @brief
/// A class for color palettes.
/// @details
/// You can instantinate this class to get dynamic color palette.
@interface
MNLColorPalette : NSObject
<NSCopying, NSMutableCopying, NSFastEnumeration, NSSecureCoding>
@property (copy, readonly, nonnull)
NSArray<NSString *> *allKeys;
@property (copy, readonly, nonnull)
NSArray<MNLColor *> *allColors;
- (instancetype _Nonnull)
initWithColorPalette:(MNLColorPalette *_Nonnull)colorPalette;
- (instancetype _Nonnull)
initWithDictionary:(NSDictionary<NSString *, MNLColor *> *_Nonnull)colorTable;
- (MNLColor *_Nullable)
colorForKey:(NSString *_Nonnull)key;
@end
#pragma mark -
/// @brief
/// A color palette for 8 real colors.
/// @note
/// Every colors are in sRGB color space.
@interface
MNL3BitColorPalette : MNLColorPalette
@property (class, nonatomic, readonly, nonnull)
MNLColor *blackColor
NS_SWIFT_NAME(black);
@property (class, nonatomic, readonly, nonnull)
MNLColor *redColor
NS_SWIFT_NAME(red);
@property (class, nonatomic, readonly, nonnull)
MNLColor *greenColor
NS_SWIFT_NAME(green);
@property (class, nonatomic, readonly, nonnull)
MNLColor *blueColor
NS_SWIFT_NAME(blue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *yellowColor
NS_SWIFT_NAME(yellow);
@property (class, nonatomic, readonly, nonnull)
MNLColor *magentaColor
NS_SWIFT_NAME(magenta);
@property (class, nonatomic, readonly, nonnull)
MNLColor *cyanColor
NS_SWIFT_NAME(cyan);
@property (class, nonatomic, readonly, nonnull)
MNLColor *whiteColor
NS_SWIFT_NAME(white);
@end
#pragma mark -
/// @brief
/// A color palette for colors which introduced on iOS Human Interface
/// Guideline.
/// @note
/// Every colors are in sRGB color space.
@interface
MNLIOSColorPalette : MNLColorPalette
@property (class, nonatomic, readonly, nonnull)
MNLColor *redColor
NS_SWIFT_NAME(red);
@property (class, nonatomic, readonly, nonnull)
MNLColor *orangeColor
NS_SWIFT_NAME(orange);
@property (class, nonatomic, readonly, nonnull)
MNLColor *yellowColor
NS_SWIFT_NAME(yellow);
@property (class, nonatomic, readonly, nonnull)
MNLColor *greenColor
NS_SWIFT_NAME(green);
@property (class, nonatomic, readonly, nonnull)
MNLColor *tealBlueColor
NS_SWIFT_NAME(tealBlue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *blueColor
NS_SWIFT_NAME(blue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *purpleColor
NS_SWIFT_NAME(purple);
@property (class, nonatomic, readonly, nonnull)
MNLColor *pinkColor
NS_SWIFT_NAME(pink);
@end
#pragma mark -
/// @brief
/// A color palette for colors which introduced on macOS Human Interface
/// Guideline.
/// @note
/// Every colors are in sRGB color space.
@interface
MNLMacOSColorPalette : MNLColorPalette
@property (class, nonatomic, readonly, nonnull)
MNLColor *blueColor
NS_SWIFT_NAME(blue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *brownColor
NS_SWIFT_NAME(brown);
@property (class, nonatomic, readonly, nonnull)
MNLColor *grayColor
NS_SWIFT_NAME(gray);
@property (class, nonatomic, readonly, nonnull)
MNLColor *greenColor
NS_SWIFT_NAME(green);
@property (class, nonatomic, readonly, nonnull)
MNLColor *orangeColor
NS_SWIFT_NAME(orange);
@property (class, nonatomic, readonly, nonnull)
MNLColor *pinkColor
NS_SWIFT_NAME(pink);
@property (class, nonatomic, readonly, nonnull)
MNLColor *purpleColor
NS_SWIFT_NAME(purple);
@property (class, nonatomic, readonly, nonnull)
MNLColor *redColor
NS_SWIFT_NAME(red);
@property (class, nonatomic, readonly, nonnull)
MNLColor *yellowColor
NS_SWIFT_NAME(yellow);
@end
#pragma mark -
/// @brief
/// A color palette for colors which introduced on watchOS Human Interface
/// Guideline.
/// @note
/// Every colors are in sRGB color space.
@interface
MNLWatchOSColorPalette : MNLColorPalette
@property (class, nonatomic, readonly, nonnull)
MNLColor *pinkColor
NS_SWIFT_NAME(pink);
@property (class, nonatomic, readonly, nonnull)
MNLColor *redColor
NS_SWIFT_NAME(red);
@property (class, nonatomic, readonly, nonnull)
MNLColor *orangeColor
NS_SWIFT_NAME(orange);
@property (class, nonatomic, readonly, nonnull)
MNLColor *yellowColor
NS_SWIFT_NAME(yellow);
@property (class, nonatomic, readonly, nonnull)
MNLColor *greenColor
NS_SWIFT_NAME(green);
@property (class, nonatomic, readonly, nonnull)
MNLColor *seafoamColor
NS_SWIFT_NAME(seafoam);
@property (class, nonatomic, readonly, nonnull)
MNLColor *lightBlueColor
NS_SWIFT_NAME(lightBlue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *blueColor
NS_SWIFT_NAME(blue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *purpleColor
NS_SWIFT_NAME(purple);
@property (class, nonatomic, readonly, nonnull)
MNLColor *whiteColor
NS_SWIFT_NAME(white);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedPinkColor
NS_SWIFT_NAME(mutedPink);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedRedColor
NS_SWIFT_NAME(mutedRed);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedOrangeColor
NS_SWIFT_NAME(mutedOrange);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedYellowColor
NS_SWIFT_NAME(mutedYellow);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedGreenColor
NS_SWIFT_NAME(mutedGreen);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedSeafoamColor
NS_SWIFT_NAME(mutedSeafoam);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedLightBlueColor
NS_SWIFT_NAME(mutedLightBlue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedBlueColor
NS_SWIFT_NAME(mutedBlue);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedPurpleColor
NS_SWIFT_NAME(mutedPurple);
@property (class, nonatomic, readonly, nonnull)
MNLColor *mutedWhiteColor
NS_SWIFT_NAME(mutedWhite);
@end
#pragma mark -
/// @brief
/// A mutable class to build dynamic color palettes.
/// @details
/// You can instantinate this class to get dynamic color palette.
@interface
MNLMutableColorPalette : MNLColorPalette
- (void)
setColor:(MNLColor *_Nonnull)color
forKey:(NSString *_Nonnull)key;
- (void)
removeColorForKey:(NSString *_Nonnull)key;
- (void)
removeAllColors;
@end
#undef __MNLCOLOR_API_REPLACEMENT
#pragma mark -
/// Framework version number for MNLColor.
FOUNDATION_EXPORT double MNLColorVersionNumber;
/// Framework version string for MNLColor.
FOUNDATION_EXPORT const unsigned char MNLColorVersionString[];