ObjFW
OFColor.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License version 3.0 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * version 3.0 for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * version 3.0 along with this program. If not, see
17  * <https://www.gnu.org/licenses/>.
18  */
19 
20 #import "OFObject.h"
21 
22 OF_ASSUME_NONNULL_BEGIN
23 
29 @interface OFColor: OFObject
30 #ifdef OF_HAVE_CLASS_PROPERTIES
31 @property (class, readonly, nonatomic) OFColor *black;
32 @property (class, readonly, nonatomic) OFColor *silver;
33 @property (class, readonly, nonatomic) OFColor *gray;
34 @property (class, readonly, nonatomic) OFColor *grey
35  OF_DEPRECATED(ObjFW, 1, 1, "Use gray instead");
36 @property (class, readonly, nonatomic) OFColor *white;
37 @property (class, readonly, nonatomic) OFColor *maroon;
38 @property (class, readonly, nonatomic) OFColor *red;
39 @property (class, readonly, nonatomic) OFColor *purple;
40 @property (class, readonly, nonatomic) OFColor *fuchsia;
41 @property (class, readonly, nonatomic) OFColor *green;
42 @property (class, readonly, nonatomic) OFColor *lime;
43 @property (class, readonly, nonatomic) OFColor *olive;
44 @property (class, readonly, nonatomic) OFColor *yellow;
45 @property (class, readonly, nonatomic) OFColor *navy;
46 @property (class, readonly, nonatomic) OFColor *blue;
47 @property (class, readonly, nonatomic) OFColor *teal;
48 @property (class, readonly, nonatomic) OFColor *aqua;
49 #endif
50 
61 + (instancetype)colorWithRed: (float)red
62  green: (float)green
63  blue: (float)blue
64  alpha: (float)alpha;
65 
73 + (OFColor *)black;
74 
82 + (OFColor *)silver;
83 
91 + (OFColor *)gray;
92 
102 + (OFColor *)grey OF_DEPRECATED(ObjFW, 1, 1, "Use gray instead");
103 
111 + (OFColor *)white;
112 
120 + (OFColor *)maroon;
121 
129 + (OFColor *)red;
130 
138 + (OFColor *)purple;
139 
147 + (OFColor *)fuchsia;
148 
156 + (OFColor *)green;
157 
165 + (OFColor *)lime;
166 
174 + (OFColor *)olive;
175 
183 + (OFColor *)yellow;
184 
192 + (OFColor *)navy;
193 
201 + (OFColor *)blue;
202 
210 + (OFColor *)teal;
211 
219 + (OFColor *)aqua;
220 
232 - (instancetype)initWithRed: (float)red
233  green: (float)green
234  blue: (float)blue
235  alpha: (float)alpha;
236 
245 - (void)getRed: (float *)red
246  green: (float *)green
247  blue: (float *)blue
248  alpha: (nullable float *)alpha;
249 @end
250 
251 OF_ASSUME_NONNULL_END
OFColor * gray()
Returns the HTML color gray.
OFColor * lime()
Returns the HTML color lime.
OFColor * grey()
Returns the HTML color gray.
Definition: OFColor.m:133
A class for storing a color.
Definition: OFColor.h:29
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
OFColor * silver()
Returns the HTML color silver.
OFColor * maroon()
Returns the HTML color maroon.
OFColor * teal()
Returns the HTML color teal.
OFColor * black()
Returns the HTML color black.
OFColor * olive()
Returns the HTML color olive.
OFColor * white()
Returns the HTML color white.
OFColor * navy()
Returns the HTML color navy.
OFColor * red()
Returns the HTML color red.
OFColor * yellow()
Returns the HTML color yellow.
OFColor * aqua()
Returns the HTML color aqua.
OFColor * green()
Returns the HTML color green.
OFColor * purple()
Returns the HTML color purple.
OFColor * blue()
Returns the HTML color blue.
OFColor * fuchsia()
Returns the HTML color fuchsia.