Skip to content

Commit b3f2d77

Browse files
committed
Added nativeColor property to CPTColor.
1 parent ebb46c5 commit b3f2d77

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎framework/Source/CPTColor.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
1111
@property (nonatomic, readonly, nonnull) UIColor *uiColor;
1212
#endif
13+
@property (nonatomic, readonly, nonnull) CPTNativeColor *nativeColor;
1314

1415
/// @name Standard Colors
1516
/// @{

‎framework/Source/CPTColor.m‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ -(UIColor *)uiColor
8282

8383
#endif
8484

85+
/** @property nonnull CPTNativeColor *nativeColor
86+
* @brief The platform-native color to wrap around.
87+
**/
88+
@dynamic nativeColor;
89+
90+
-(CPTNativeColor *)nativeColor
91+
{
92+
#if TARGET_OS_OSX
93+
return self.nsColor;
94+
#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE
95+
return self.uiColor;
96+
#endif
97+
}
98+
8599
/** @property nonnull CGColorRef cgColor
86100
* @brief The @ref CGColorRef to wrap around.
87101
**/

0 commit comments

Comments
 (0)