ObjFW
OFColor.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
25 @interface OFColor: OFObject
26 #ifdef OF_HAVE_CLASS_PROPERTIES
27 @property (class, readonly, nonatomic) OFColor *black;
28 @property (class, readonly, nonatomic) OFColor *silver;
29 @property (class, readonly, nonatomic) OFColor *grey;
30 @property (class, readonly, nonatomic) OFColor *white;
31 @property (class, readonly, nonatomic) OFColor *maroon;
32 @property (class, readonly, nonatomic) OFColor *red;
33 @property (class, readonly, nonatomic) OFColor *purple;
34 @property (class, readonly, nonatomic) OFColor *fuchsia;
35 @property (class, readonly, nonatomic) OFColor *green;
36 @property (class, readonly, nonatomic) OFColor *lime;
37 @property (class, readonly, nonatomic) OFColor *olive;
38 @property (class, readonly, nonatomic) OFColor *yellow;
39 @property (class, readonly, nonatomic) OFColor *navy;
40 @property (class, readonly, nonatomic) OFColor *blue;
41 @property (class, readonly, nonatomic) OFColor *teal;
42 @property (class, readonly, nonatomic) OFColor *aqua;
43 #endif
44 
55 + (instancetype)colorWithRed: (float)red
56  green: (float)green
57  blue: (float)blue
58  alpha: (float)alpha;
59 
67 + (OFColor *)black;
68 
76 + (OFColor *)silver;
77 
85 + (OFColor *)grey;
86 
94 + (OFColor *)white;
95 
103 + (OFColor *)maroon;
104 
112 + (OFColor *)red;
113 
121 + (OFColor *)purple;
122 
130 + (OFColor *)fuchsia;
131 
139 + (OFColor *)green;
140 
148 + (OFColor *)lime;
149 
157 + (OFColor *)olive;
158 
166 + (OFColor *)yellow;
167 
175 + (OFColor *)navy;
176 
184 + (OFColor *)blue;
185 
193 + (OFColor *)teal;
194 
202 + (OFColor *)aqua;
203 
215 - (instancetype)initWithRed: (float)red
216  green: (float)green
217  blue: (float)blue
218  alpha: (float)alpha;
219 
228 - (void)getRed: (float *)red
229  green: (float *)green
230  blue: (float *)blue
231  alpha: (nullable float *)alpha;
232 @end
233 
234 OF_ASSUME_NONNULL_END
OFColor * lime()
Returns the HTML color lime.
OFColor * grey()
Returns the HTML color grey.
A class for storing a color.
Definition: OFColor.h:25
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
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.