-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMNL3BitColorPalette.m
102 lines (83 loc) · 2.72 KB
/
MNL3BitColorPalette.m
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
#import "MNLColorInternal.h"
/// @brief
/// A private variable for Black colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(0, 0, 0)
static MNLColor *MNL3BitBlackColor;
/// @brief
/// A private variable for Red colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(255, 0, 0)
static MNLColor *MNL3BitRedColor;
/// @brief
/// A private variable for Green colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(0, 255, 0)
static MNLColor *MNL3BitGreenColor;
/// @brief
/// A private variable for Blue colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(0, 0, 255)
static MNLColor *MNL3BitBlueColor;
/// @brief
/// A private variable for Yellow colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(255, 255, 0)
static MNLColor *MNL3BitYellowColor;
/// @brief
/// A private variable for Magenta colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(255, 0, 255)
static MNLColor *MNL3BitMagentaColor;
/// @brief
/// A private variable for Cyan colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(0, 255, 255)
static MNLColor *MNL3BitCyanColor;
/// @brief
/// A private variable for White colour.
/// @details
/// This variable is for implement a singleton.
/// @note
/// rgb(255, 255, 255)
static MNLColor *MNL3BitWhiteColor;
@implementation MNL3BitColorPalette
+ (MNLColor *)blackColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:0 green:0 blue:0 colorSpace:MNLColorSpaceSRGB], MNL3BitBlackColor);
}
+ (MNLColor *)redColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:1 green:0 blue:0 colorSpace:MNLColorSpaceSRGB], MNL3BitRedColor);
}
+ (MNLColor *)greenColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:0 green:1 blue:0 colorSpace:MNLColorSpaceSRGB], MNL3BitGreenColor);
}
+ (MNLColor *)blueColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:0 green:0 blue:1 colorSpace:MNLColorSpaceSRGB], MNL3BitBlueColor);
}
+ (MNLColor *)yellowColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:1 green:1 blue:0 colorSpace:MNLColorSpaceSRGB], MNL3BitYellowColor);
}
+ (MNLColor *)magentaColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:1 green:0 blue:1 colorSpace:MNLColorSpaceSRGB], MNL3BitMagentaColor);
}
+ (MNLColor *)cyanColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:0 green:1 blue:1 colorSpace:MNLColorSpaceSRGB], MNL3BitCyanColor);
}
+ (MNLColor *)whiteColor {
MNLReturnSingletonColor([[MNLColor alloc] initWithRed:1 green:1 blue:1 colorSpace:MNLColorSpaceSRGB], MNL3BitWhiteColor);
}
@end