CLRColor
Objective-C
@interface CLRColor : NSObject <NSMutableCopying>
Swift
class CLRColor
Color representation with support for hex, RBG, arithmetic RBG, and integer colors
-
Red arithmetic color value
Declaration
Objective-C
@property (nonatomic) float redArithmetic;
Swift
var redArithmetic: Float { get set }
-
Green arithmetic color value
Declaration
Objective-C
@property (nonatomic) float greenArithmetic;
Swift
var greenArithmetic: Float { get set }
-
Blue arithmetic color value
Declaration
Objective-C
@property (nonatomic) float blueArithmetic;
Swift
var blueArithmetic: Float { get set }
-
Opacity arithmetic value
Declaration
Objective-C
@property (nonatomic) float opacity;
Swift
var opacity: Float { get set }
-
Create a black color
Declaration
Objective-C
+ (CLRColor *)black;
Swift
class func black() -> CLRColor!
Return Value
color
-
Create a blue color
Declaration
Objective-C
+ (CLRColor *)blue;
Swift
class func blue() -> CLRColor!
Return Value
color
-
Create a brown color
Declaration
Objective-C
+ (CLRColor *)brown;
Swift
class func brown() -> CLRColor!
Return Value
color
-
Create a cyan color
Declaration
Objective-C
+ (CLRColor *)cyan;
Swift
class func cyan() -> CLRColor!
Return Value
color
-
Create a dark gray color
Declaration
Objective-C
+ (CLRColor *)darkGray;
Swift
class func darkGray() -> CLRColor!
Return Value
color
-
Create a gray color
Declaration
Objective-C
+ (CLRColor *)gray;
Swift
class func gray() -> CLRColor!
Return Value
color
-
Create a green color
Declaration
Objective-C
+ (CLRColor *)green;
Swift
class func green() -> CLRColor!
Return Value
color
-
Create a light gray color
Declaration
Objective-C
+ (CLRColor *)lightGray;
Swift
class func lightGray() -> CLRColor!
Return Value
color
-
Create a magenta color
Declaration
Objective-C
+ (CLRColor *)magenta;
Swift
class func magenta() -> CLRColor!
Return Value
color
-
Create an orange color
Declaration
Objective-C
+ (CLRColor *)orange;
Swift
class func orange() -> CLRColor!
Return Value
color
-
Create a pink color
Declaration
Objective-C
+ (CLRColor *)pink;
Swift
class func pink() -> CLRColor!
Return Value
color
-
Create a purple color
Declaration
Objective-C
+ (CLRColor *)purple;
Swift
class func purple() -> CLRColor!
Return Value
color
-
Create a red color
Declaration
Objective-C
+ (CLRColor *)red;
Swift
class func red() -> CLRColor!
Return Value
color
-
Create a violet color
Declaration
Objective-C
+ (CLRColor *)violet;
Swift
class func violet() -> CLRColor!
Return Value
color
-
Create a white color
Declaration
Objective-C
+ (CLRColor *)white;
Swift
class func white() -> CLRColor!
Return Value
color
-
Create a yellow color
Declaration
Objective-C
+ (CLRColor *)yellow;
Swift
class func yellow() -> CLRColor!
Return Value
color
-
Create the color in hex
Declaration
Objective-C
+ (CLRColor *)colorWithHex:(NSString *)color;
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
Return Value
color
-
Create the color in hex with an opacity
Declaration
Objective-C
+ (CLRColor *)colorWithHex:(NSString *)color andOpacity:(float)opacity;
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
color
-
Create the color in hex with an alpha
Declaration
Objective-C
+ (CLRColor *)colorWithHex:(NSString *)color andAlpha:(int)alpha;
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alpha
alpha integer color inclusively between 0 and 255
Return Value
color
-
Create the color with individual hex colors
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue;
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
Return Value
color
-
Create the color with individual hex colors and alpha
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andAlpha:(NSString *)alpha;
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
alpha
alpha hex color in format AA
Return Value
color
-
Create the color with individual hex colors and opacity
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andOpacity:(float)opacity;
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
color
-
Create the color with RGB values
Declaration
Objective-C
+ (CLRColor *)colorWithRed:(int)red andGreen:(int)green andBlue:(int)blue;
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
Return Value
color
-
Create the color with RGBA values
Declaration
Objective-C
+ (CLRColor *)colorWithRed:(int)red andGreen:(int)green andBlue:(int)blue andAlpha:(int)alpha;
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
alpha
alpha integer color inclusively between 0 and 255
Return Value
color
-
Create the color with RGBA values
Declaration
Objective-C
+ (CLRColor *)colorWithRed:(int)red andGreen:(int)green andBlue:(int)blue andOpacity:(float)opacity;
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
color
-
Create the color with arithmetic RGB values
Declaration
Objective-C
+ (CLRColor *)colorWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue;
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
Return Value
color
-
Create the color with arithmetic RGB values
Declaration
Objective-C
+ (CLRColor *)colorWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue andOpacity:(float)opacity;
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
color
-
Create the color with HSL (hue, saturation, lightness) or HSL (alpha) values
Declaration
Objective-C
+ (CLRColor *)colorWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness;
Parameters
hue
hue
saturation
saturation
lightness
lightness
Return Value
color
-
Create the color with HSLA (hue, saturation, lightness, alpha) values
Declaration
Objective-C
+ (CLRColor *)colorWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness andAlpha:(float)alpha;
Parameters
hue
hue
saturation
saturation
lightness
lightness
alpha
alpha inclusively between 0.0 and 1.0
Return Value
color
-
Create the color as a single integer
Declaration
Objective-C
+ (CLRColor *)colorWithColor:(int)color;
Parameters
color
color integer
Return Value
color
-
Create the color as a single unsigned integer
Declaration
Objective-C
+ (CLRColor *)colorWithUnsignedColor:(unsigned int)color;
Parameters
color
color unsigned integer
Return Value
color
-
Default color initializer, opaque black
Declaration
Objective-C
- (instancetype)init;
Swift
init!()
Return Value
new color
-
Create the color in hex
Declaration
Objective-C
- (instancetype)initWithHex:(NSString *)color;
Swift
init!(hex color: Any!)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
Return Value
new color
-
Create the color in hex with an opacity
Declaration
Objective-C
- (instancetype)initWithHex:(NSString *)color andOpacity:(float)opacity;
Swift
init!(hex color: Any!, andOpacity opacity: Float)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color in hex with an alpha
Declaration
Objective-C
- (instancetype)initWithHex:(NSString *)color andAlpha:(int)alpha;
Swift
init!(hex color: Any!, andAlpha alpha: Int32)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alpha
alpha integer color inclusively between 0 and 255
Return Value
new color
-
Create the color with individual hex colors
Declaration
Objective-C
- (instancetype)initWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue;
Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
Return Value
new color
-
Create the color with individual hex colors and alpha
Declaration
Objective-C
- (instancetype)initWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andAlpha:(NSString *)alpha;
Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!, andAlpha alpha: Any!)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
alpha
alpha hex color in format AA
Return Value
new color
-
Create the color with individual hex colors and opacity
Declaration
Objective-C
- (instancetype)initWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andOpacity:(float)opacity;
Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!, andOpacity opacity: Float)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color with RGB values
Declaration
Objective-C
- (instancetype)initWithRed:(int)red andGreen:(int)green andBlue:(int)blue;
Swift
init!(red: Int32, andGreen green: Int32, andBlue blue: Int32)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
Return Value
new color
-
Create the color with RGBA values
Declaration
Objective-C
- (instancetype)initWithRed:(int)red andGreen:(int)green andBlue:(int)blue andAlpha:(int)alpha;
Swift
init!(red: Int32, andGreen green: Int32, andBlue blue: Int32, andAlpha alpha: Int32)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
alpha
alpha integer color inclusively between 0 and 255
Return Value
new color
-
Create the color with RGBA values
Declaration
Objective-C
- (instancetype)initWithRed:(int)red andGreen:(int)green andBlue:(int)blue andOpacity:(float)opacity;
Swift
init!(red: Int32, andGreen green: Int32, andBlue blue: Int32, andOpacity opacity: Float)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color with arithmetic RGB values
Declaration
Objective-C
- (instancetype)initWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue;
Swift
init!(arithmeticRed red: Float, andGreen green: Float, andBlue blue: Float)
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color with arithmetic RGB values
Declaration
Objective-C
- (instancetype)initWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue andOpacity:(float)opacity;
Swift
init!(arithmeticRed red: Float, andGreen green: Float, andBlue blue: Float, andOpacity opacity: Float)
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
opacity
opacity float inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color with HSL (hue, saturation, lightness) or HSL (alpha) values
Declaration
Objective-C
- (instancetype)initWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness;
Swift
init!(hue: Float, andSaturation saturation: Float, andLightness lightness: Float)
Parameters
hue
hue
saturation
saturation
lightness
lightness
Return Value
new color
-
Create the color with HSLA (hue, saturation, lightness, alpha) values
Declaration
Objective-C
- (instancetype)initWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness andAlpha:(float)alpha;
Swift
init!(hue: Float, andSaturation saturation: Float, andLightness lightness: Float, andAlpha alpha: Float)
Parameters
hue
hue
saturation
saturation
lightness
lightness
alpha
alpha inclusively between 0.0 and 1.0
Return Value
new color
-
Create the color as a single integer
Declaration
Objective-C
- (instancetype)initWithColor:(int)color;
Swift
init!(color: Int32)
Parameters
color
color integer
Return Value
new color
-
Create the color as a single unsigned integer
Declaration
Objective-C
- (instancetype)initWithUnsignedColor:(unsigned int)color;
Swift
init!(unsignedColor color: UInt32)
Parameters
color
color unsigned integer
Return Value
new color
-
Copy Initialize
Declaration
Objective-C
- (instancetype)initWithCLRColor:(CLRColor *)color;
Swift
init!(clrColor color: CLRColor!)
Parameters
color
color to copy
Return Value
new color
-
Set the color in hex
Declaration
Objective-C
- (void)setColorWithHex:(NSString *)color;
Swift
func setColorWithHex(_ color: Any!)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
-
Set the color in hex with an opacity
Declaration
Objective-C
- (void)setColorWithHex:(NSString *)color andOpacity:(float)opacity;
Swift
func setColorWithHex(_ color: Any!, andOpacity opacity: Float)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacity
opacity float inclusively between 0.0 and 1.0
-
Set the color in hex with an alpha
Declaration
Objective-C
- (void)setColorWithHex:(NSString *)color andAlpha:(int)alpha;
Swift
func setColorWithHex(_ color: Any!, andAlpha alpha: Int32)
Parameters
color
hex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alpha
alpha integer color inclusively between 0 and 255
-
Set the color with individual hex colors
Declaration
Objective-C
- (void)setColorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue;
Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
-
Set the color with individual hex colors and alpha
Declaration
Objective-C
- (void)setColorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andAlpha:(NSString *)alpha;
Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!, andAlpha alpha: Any!)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
alpha
alpha hex color in format AA
-
Set the color with individual hex colors and opacity
Declaration
Objective-C
- (void)setColorWithHexRed:(NSString *)red andGreen:(NSString *)green andBlue:(NSString *)blue andOpacity:(float)opacity;
Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!, andOpacity opacity: Float)
Parameters
red
red hex color in format RR
green
green hex color in format GG
blue
blue hex color in format BB
opacity
opacity float inclusively between 0.0 and 1.0
-
Set the color with RGB values
Declaration
Objective-C
- (void)setColorWithRed:(int)red andGreen:(int)green andBlue:(int)blue;
Swift
func setColorWithRed(_ red: Int32, andGreen green: Int32, andBlue blue: Int32)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
-
Set the color with RGBA values
Declaration
Objective-C
- (void)setColorWithRed:(int)red andGreen:(int)green andBlue:(int)blue andAlpha:(int)alpha;
Swift
func setColorWithRed(_ red: Int32, andGreen green: Int32, andBlue blue: Int32, andAlpha alpha: Int32)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
alpha
alpha integer color inclusively between 0 and 255
-
Set the color with RGBA values
Declaration
Objective-C
- (void)setColorWithRed:(int)red andGreen:(int)green andBlue:(int)blue andOpacity:(float)opacity;
Swift
func setColorWithRed(_ red: Int32, andGreen green: Int32, andBlue blue: Int32, andOpacity opacity: Float)
Parameters
red
red integer color inclusively between 0 and 255
green
green integer color inclusively between 0 and 255
blue
blue integer color inclusively between 0 and 255
opacity
opacity float inclusively between 0.0 and 1.0
-
Set the color with arithmetic RGB values
Declaration
Objective-C
- (void)setColorWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue;
Swift
func setColorWithArithmeticRed(_ red: Float, andGreen green: Float, andBlue blue: Float)
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
-
Set the color with arithmetic RGB values
Declaration
Objective-C
- (void)setColorWithArithmeticRed:(float)red andGreen:(float)green andBlue:(float)blue andOpacity:(float)opacity;
Swift
func setColorWithArithmeticRed(_ red: Float, andGreen green: Float, andBlue blue: Float, andOpacity opacity: Float)
Parameters
red
red float color inclusively between 0.0 and 1.0
green
green float color inclusively between 0.0 and 1.0
blue
blue float color inclusively between 0.0 and 1.0
opacity
opacity float inclusively between 0.0 and 1.0
-
Set the color with HSL (hue, saturation, lightness) values
Declaration
Objective-C
- (void)setColorWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness;
Swift
func setColorWithHue(_ hue: Float, andSaturation saturation: Float, andLightness lightness: Float)
Parameters
hue
hue value inclusively between 0.0 and 360.0
saturation
saturation inclusively between 0.0 and 1.0
lightness
lightness inclusively between 0.0 and 1.0
-
Set the color with HSLA (hue, saturation, lightness, alpha) values
Declaration
Objective-C
- (void)setColorWithHue:(float)hue andSaturation:(float)saturation andLightness:(float)lightness andAlpha:(float)alpha;
Swift
func setColorWithHue(_ hue: Float, andSaturation saturation: Float, andLightness lightness: Float, andAlpha alpha: Float)
Parameters
hue
hue value inclusively between 0.0 and 360.0
saturation
saturation inclusively between 0.0 and 1.0
lightness
lightness inclusively between 0.0 and 1.0
alpha
alpha inclusively between 0.0 and 1.0
-
Set the color as a single integer
Declaration
Objective-C
- (void)setColor:(int)color;
Swift
func setColor(_ color: Int32)
Parameters
color
color integer
-
Set the color as a single unsigned integer
Declaration
Objective-C
- (void)setUnsignedColor:(unsigned int)color;
Swift
func setUnsigned(_ color: UInt32)
Parameters
color
color unsigned integer
-
Set the red color in hex
Declaration
Objective-C
- (void)setRedHex:(NSString *)red;
Swift
func setRedHex(_ red: Any!)
Parameters
red
red hex color in format RR or R
-
Set the green color in hex
Declaration
Objective-C
- (void)setGreenHex:(NSString *)green;
Swift
func setGreenHex(_ green: Any!)
Parameters
green
green hex color in format GG or G
-
Set the blue color in hex
Declaration
Objective-C
- (void)setBlueHex:(NSString *)blue;
Swift
func setBlueHex(_ blue: Any!)
Parameters
blue
blue hex color in format BB or B
-
Set the alpha color in hex
Declaration
Objective-C
- (void)setAlphaHex:(NSString *)alpha;
Swift
func setAlphaHex(_ alpha: Any!)
Parameters
alpha
alpha hex color in format AA or A
-
Set the red color as an integer
Declaration
Objective-C
- (void)setRed:(int)red;
Swift
func setRed(_ red: Int32)
Parameters
red
red integer color inclusively between 0 and 255
-
Set the green color as an integer
Declaration
Objective-C
- (void)setGreen:(int)green;
Swift
func setGreen(_ green: Int32)
Parameters
green
green integer color inclusively between 0 and 255
-
Set the blue color as an integer
Declaration
Objective-C
- (void)setBlue:(int)blue;
Swift
func setBlue(_ blue: Int32)
Parameters
blue
blue integer color inclusively between 0 and 255
-
Set the alpha color as an integer
Declaration
Objective-C
- (void)setAlpha:(int)alpha;
Swift
func setAlpha(_ alpha: Int32)
Parameters
alpha
alpha integer color inclusively between 0 and 255
-
Set the alpha color as an arithmetic float
Declaration
Objective-C
- (void)setAlphaArithmetic:(float)alpha;
Swift
func setAlphaArithmetic(_ alpha: Float)
Parameters
alpha
alpha float color inclusively between 0.0 and 1.0
-
Check if the color is opaque (opacity or alpha of 1.0, 255, or x00)
Declaration
Objective-C
- (BOOL)isOpaque;
Swift
func isOpaque() -> Any!
Return Value
true if opaque
-
Get a UIColor from this color
Declaration
Objective-C
- (id)uiColor;
Swift
func uiColor() -> Any!
Return Value
color
-
Get the color as a hex string
Declaration
Objective-C
- (NSString *)colorHex;
Swift
func colorHex() -> Any!
Return Value
hex color in the format #RRGGBB
-
Get the color as a hex string with alpha
Declaration
Objective-C
- (NSString *)colorHexWithAlpha;
Swift
func colorHexWithAlpha() -> Any!
Return Value
hex color in the format #AARRGGBB
-
Get the color as a hex string, shorthanded when possible
Declaration
Objective-C
- (NSString *)colorHexShorthand;
Swift
func colorHexShorthand() -> Any!
Return Value
hex color in the format #RGB or #RRGGBB
-
Get the color as a hex string with alpha, shorthanded when possible
Declaration
Objective-C
- (NSString *)colorHexShorthandWithAlpha;
Swift
func colorHexShorthandWithAlpha() -> Any!
Return Value
hex color in the format #ARGB or #AARRGGBB
-
Get the color as an integer
Declaration
Objective-C
- (int)color;
Swift
func color() -> Int32
Return Value
integer color
-
Get the color as an unsigned integer
Declaration
Objective-C
- (unsigned int)unsignedColor;
Swift
func unsignedColor() -> UInt32
Return Value
unsigned integer color
-
Get the color as an integer including the alpha
Declaration
Objective-C
- (int)colorWithAlpha;
Swift
func colorWithAlpha() -> Int32
Return Value
integer color
-
Get the color as an unsigned integer including the alpha
Declaration
Objective-C
- (unsigned int)unsignedColorWithAlpha;
Swift
func unsignedColorWithAlpha() -> UInt32
Return Value
unsigned integer color
-
Get the red color in hex
Declaration
Objective-C
- (NSString *)redHex;
Swift
func redHex() -> Any!
Return Value
red hex color in format RR
-
Get the green color in hex
Declaration
Objective-C
- (NSString *)greenHex;
Swift
func greenHex() -> Any!
Return Value
green hex color in format GG
-
Get the blue color in hex
Declaration
Objective-C
- (NSString *)blueHex;
Swift
func blueHex() -> Any!
Return Value
blue hex color in format BB
-
Get the alpha color in hex
Declaration
Objective-C
- (NSString *)alphaHex;
Swift
func alphaHex() -> Any!
Return Value
alpha hex color in format AA
-
Get the red color in hex, shorthand when possible
Declaration
Objective-C
- (NSString *)redHexShorthand;
Swift
func redHexShorthand() -> Any!
Return Value
red hex color in format R or RR
-
Get the green color in hex, shorthand when possible
Declaration
Objective-C
- (NSString *)greenHexShorthand;
Swift
func greenHexShorthand() -> Any!
Return Value
green hex color in format G or GG
-
Get the blue color in hex, shorthand when possible
Declaration
Objective-C
- (NSString *)blueHexShorthand;
Swift
func blueHexShorthand() -> Any!
Return Value
blue hex color in format B or BB
-
Get the alpha color in hex, shorthand when possible
Declaration
Objective-C
- (NSString *)alphaHexShorthand;
Swift
func alphaHexShorthand() -> Any!
Return Value
alpha hex color in format A or AA
-
Get the red color as an integer
Declaration
Objective-C
- (int)red;
Swift
func red() -> Int32
Return Value
red integer color inclusively between 0 and 255
-
Get the green color as an integer
Declaration
Objective-C
- (int)green;
Swift
func green() -> Int32
Return Value
green integer color inclusively between 0 and 255
-
Get the blue color as an integer
Declaration
Objective-C
- (int)blue;
Swift
func blue() -> Int32
Return Value
blue integer color inclusively between 0 and 255
-
Get the alpha color as an integer
Declaration
Objective-C
- (int)alpha;
Swift
func alpha() -> Int32
Return Value
alpha integer color inclusively between 0 and 255
-
Get the alpha color as an arithmetic float
Declaration
Objective-C
- (float)alphaArithmetic;
Swift
func alphaArithmetic() -> Float
Return Value
alpha float color inclusively between 0.0 and 1.0
-
Get the HSL (hue, saturation, lightness) values
Declaration
Objective-C
- (float *)hsl;
Swift
func hsl() -> UnsafeMutablePointer<Float>!
Return Value
HSL array where: 0 = hue, 1 = saturation, 2 = lightness
-
Get the HSL hue value
Declaration
Objective-C
- (float)hue;
Swift
func hue() -> Float
Return Value
hue value
-
Get the HSL saturation value
Declaration
Objective-C
- (float)saturation;
Swift
func saturation() -> Float
Return Value
saturation value
-
Get the HSL lightness value
Declaration
Objective-C
- (float)lightness;
Swift
func lightness() -> Float
Return Value
lightness value