Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTColor.h
Go to the documentation of this file.
2 
4 
5 @property (nonatomic, readonly, nonnull) CGColorRef cgColor;
6 @property (nonatomic, readonly, getter = isOpaque) BOOL opaque;
7 
8 #if TARGET_OS_OSX
9 @property (nonatomic, readonly, nonnull) NSColor *nsColor;
10 #elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
11 @property (nonatomic, readonly, nonnull) UIColor *uiColor;
12 #endif
13 @property (nonatomic, readonly, nonnull) CPTNativeColor *nativeColor;
14 
17 +(nonnull instancetype)clearColor;
18 +(nonnull instancetype)whiteColor;
19 +(nonnull instancetype)lightGrayColor;
20 +(nonnull instancetype)grayColor;
21 +(nonnull instancetype)darkGrayColor;
22 +(nonnull instancetype)blackColor;
23 +(nonnull instancetype)redColor;
24 +(nonnull instancetype)greenColor;
25 +(nonnull instancetype)blueColor;
26 +(nonnull instancetype)cyanColor;
27 +(nonnull instancetype)yellowColor;
28 +(nonnull instancetype)magentaColor;
29 +(nonnull instancetype)orangeColor;
30 +(nonnull instancetype)purpleColor;
31 +(nonnull instancetype)brownColor;
33 
36 +(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor;
37 +(nonnull instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
38 +(nonnull instancetype)colorWithGenericGray:(CGFloat)gray;
39 
40 #if TARGET_OS_OSX
41 +(nonnull instancetype)colorWithNSColor:(nonnull NSColor *)newNSColor;
42 #elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
43 +(nonnull instancetype)colorWithUIColor:(nonnull UIColor *)newUIColor;
44 #endif
45 +(nonnull instancetype)colorWithNativeColor:(nonnull CPTNativeColor *)newColor;
46 
48 
51 -(nonnull instancetype)initWithCGColor:(nonnull CGColorRef)cgColor NS_DESIGNATED_INITIALIZER;
52 -(nonnull instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
53 -(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
54 
55 #if TARGET_OS_OSX
56 -(nonnull instancetype)initWithNSColor:(nonnull NSColor *)newNSColor NS_DESIGNATED_INITIALIZER;
57 #elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
58 -(nonnull instancetype)initWithUIColor:(nonnull UIColor *)newUIColor NS_DESIGNATED_INITIALIZER;
59 #endif
60 -(nonnull instancetype)initWithNativeColor:(nonnull CPTNativeColor *)newColor;
61 
62 -(nonnull instancetype)colorWithAlphaComponent:(CGFloat)alpha;
64 
65 @end
CGColorRef
typedef CGColorRef
+[CPTColor magentaColor]
nonnull instancetype magentaColor()
Returns a shared instance of CPTColor initialized with a fully opaque magenta color.
Definition: CPTColor.m:326
+[CPTColor whiteColor]
nonnull instancetype whiteColor()
Returns a shared instance of CPTColor initialized with a fully opaque white color.
Definition: CPTColor.m:154
NSObject
+[CPTColor brownColor]
nonnull instancetype brownColor()
Returns a shared instance of CPTColor initialized with a fully opaque brown color.
Definition: CPTColor.m:372
CPTColor::nativeColor
CPTNativeColor * nativeColor
The platform-native color to wrap around.
Definition: CPTColor.h:13
+[CPTColor lightGrayColor]
nonnull instancetype lightGrayColor()
Returns a shared instance of CPTColor initialized with a fully opaque 67% gray color.
Definition: CPTColor.m:170
CPTColor
An immutable color.
Definition: CPTColor.h:3
+[CPTColor grayColor]
nonnull instancetype grayColor()
Returns a shared instance of CPTColor initialized with a fully opaque 50% gray color.
Definition: CPTColor.m:186
CPTPlatformSpecificDefines.h
CPTColor::cgColor
CGColorRef cgColor
The CGColorRef to wrap around.
Definition: CPTColor.h:5
+[CPTColor greenColor]
nonnull instancetype greenColor()
Returns a shared instance of CPTColor initialized with a fully opaque green color.
Definition: CPTColor.m:253
+[CPTColor purpleColor]
nonnull instancetype purpleColor()
Returns a shared instance of CPTColor initialized with a fully opaque purple color.
Definition: CPTColor.m:356
+[CPTColor cyanColor]
nonnull instancetype cyanColor()
Returns a shared instance of CPTColor initialized with a fully opaque cyan color.
Definition: CPTColor.m:291
CPTColor::opaque
BOOL opaque
If YES, the color is completely opaque.
Definition: CPTColor.h:6
+[CPTColor blackColor]
nonnull instancetype blackColor()
Returns a shared instance of CPTColor initialized with a fully opaque black color.
Definition: CPTColor.m:218
CGFloat
typedef CGFloat
+[CPTColor blueColor]
nonnull instancetype blueColor()
Returns a shared instance of CPTColor initialized with a fully opaque blue color.
Definition: CPTColor.m:272
+[CPTColor yellowColor]
nonnull instancetype yellowColor()
Returns a shared instance of CPTColor initialized with a fully opaque yellow color.
Definition: CPTColor.m:310
+[CPTColor redColor]
nonnull instancetype redColor()
Returns a shared instance of CPTColor initialized with a fully opaque red color.
Definition: CPTColor.m:234
+[CPTColor clearColor]
nonnull instancetype clearColor()
Returns a shared instance of CPTColor initialized with a fully transparent color.
Definition: CPTColor.m:132
+[CPTColor darkGrayColor]
nonnull instancetype darkGrayColor()
Returns a shared instance of CPTColor initialized with a fully opaque 33% gray color.
Definition: CPTColor.m:202
NSSecureCoding-p
+[CPTColor orangeColor]
nonnull instancetype orangeColor()
Returns a shared instance of CPTColor initialized with a fully opaque orange color.
Definition: CPTColor.m:340
NSCoder