Skip to content
Newer
Older
100644 83 lines (59 sloc) 2.3 KB
f3d43b6 @soffes The Great Rename
soffes authored
1 //
2 // UIColor+SSToolkitAdditions.h
3 // SSToolkit
4 //
5 // Created by Sam Soffes on 4/19/10.
e8c3ce3 @soffes Updated comments and renamed SSDrawingMacros to SSDrawingUtilities
soffes authored
6 // Copyright 2010-2011 Sam Soffes. All rights reserved.
f3d43b6 @soffes The Great Rename
soffes authored
7 //
8
072f882 @soffes More documentation. #24 #25
soffes authored
9 /**
10 Provides extensions to `UIColor` for various common tasks.
11 */
f3d43b6 @soffes The Great Rename
soffes authored
12 @interface UIColor (SSToolkitAdditions)
13
f63bf11 @soffes More documentation
soffes authored
14 /**
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
15 Creates and returns an UIColor object containing a given value.
16
56bf569 @soffes Add alpha support to UIColor hex categories
soffes authored
17 @param hex The value for the new color. The `#` sign is not required.
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
18
19 @return An UIColor object containing a value.
20
56bf569 @soffes Add alpha support to UIColor hex categories
soffes authored
21 You can specify hex values in the following formats: `rgb`, `rrggbb`, or `rrggbbaa`.
22
23 The default alpha value is `1.0`.
24
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
25 */
5b6fc0b @soffes Renamed UIColor hex categories to be more consistent with Apple's naming
soffes authored
26 + (UIColor *)colorWithHex:(NSString *)hex;
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
27
28 /**
29 Returns the receiver's value as a hex string.
30
31 @return The receiver's value as a hex string.
32
56bf569 @soffes Add alpha support to UIColor hex categories
soffes authored
33 The value will be `nil` if the color is in a color space other than Grayscale or RGB. The `#` sign is omitted. Alpha
34 will be omitted.
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
35 */
5b6fc0b @soffes Renamed UIColor hex categories to be more consistent with Apple's naming
soffes authored
36 - (NSString *)hexValue;
2dac7b0 @soffes Added UIColor category methods for working with hex strings
soffes authored
37
38 /**
56bf569 @soffes Add alpha support to UIColor hex categories
soffes authored
39 Returns the receiver's value as a hex string.
40
41 @param includeAlpha `YES` if alpha should be included. `NO` if it should not.
42
43 @return The receiver's value as a hex string.
44
45 The value will be `nil` if the color is in a color space other than Grayscale or RGB. The `#` sign is omitted. Alpha is
46 included if `includeAlpha` is `YES`.
47 */
48 - (NSString *)hexValueWithAlpha:(BOOL)includeAlpha;
49
50 /**
1a761cb @soffes Added `red`, `green`, and `blue` read-only properties to UIColor cate…
soffes authored
51 The receiver's red component value. (read-only)
52
53 The value of this property is a floating-point number in the range `0.0` to `1.0`. `-1.0` is returned if the color is
54 not in the RGB colorspace.
55 */
56 @property (nonatomic, assign, readonly) CGFloat red;
57
58 /**
59 The receiver's green component value. (read-only)
60
61 The value of this property is a floating-point number in the range `0.0` to `1.0`. `-1.0` is returned if the color is
62 not in the RGB colorspace.
63 */
64 @property (nonatomic, assign, readonly) CGFloat green;
65
66 /**
67 The receiver's blue component value. (read-only)
68
69 The value of this property is a floating-point number in the range `0.0` to `1.0`. `-1.0` is returned if the color is
70 not in the RGB colorspace.
71 */
72 @property (nonatomic, assign, readonly) CGFloat blue;
73
74 /**
f63bf11 @soffes More documentation
soffes authored
75 The receiver's alpha value. (read-only)
76
77 The value of this property is a floating-point number in the range `0.0` to `1.0`, where `0.0` represents totally
78 transparent and `1.0` represents totally opaque.
79 */
6850409 @soffes Categories
soffes authored
80 @property (nonatomic, assign, readonly) CGFloat alpha;
f3d43b6 @soffes The Great Rename
soffes authored
81
82 @end
Something went wrong with that request. Please try again.