CLRColor
Objective-C
@interface CLRColor
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:(id)color;Parameters
colorhex 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:(id)color andOpacity:(float)opacity;Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacityopacity float inclusively between 0.0 and 1.0
Return Value
color
-
Create the color in hex with an alpha
Declaration
Objective-C
+ (CLRColor *)colorWithHex:(id)color andAlpha:(int)alpha;Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alphaalpha integer color inclusively between 0 and 255
Return Value
color
-
Create the color with individual hex colors
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue;Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
Return Value
color
-
Create the color with individual hex colors and alpha
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andAlpha:(id)alpha;Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
alphaalpha hex color in format AA
Return Value
color
-
Create the color with individual hex colors and opacity
Declaration
Objective-C
+ (CLRColor *)colorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andOpacity:(float)opacity;Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
opacityopacity 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
alphaalpha 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
opacityopacity 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue float color inclusively between 0.0 and 1.0
opacityopacity 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
huehue
saturationsaturation
lightnesslightness
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
huehue
saturationsaturation
lightnesslightness
alphaalpha 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
colorcolor integer
Return Value
color
-
Create the color as a single unsigned integer
Declaration
Objective-C
+ (CLRColor *)colorWithUnsignedColor:(unsigned int)color;Parameters
colorcolor 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:(id)color;Swift
init!(hex color: Any!)Parameters
colorhex 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:(id)color andOpacity:(float)opacity;Swift
init!(hex color: Any!, andOpacity opacity: Float)Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacityopacity 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:(id)color andAlpha:(int)alpha;Swift
init!(hex color: Any!, andAlpha alpha: Int32)Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alphaalpha integer color inclusively between 0 and 255
Return Value
new color
-
Create the color with individual hex colors
Declaration
Objective-C
- (instancetype)initWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue;Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
Return Value
new color
-
Create the color with individual hex colors and alpha
Declaration
Objective-C
- (instancetype)initWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andAlpha:(id)alpha;Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!, andAlpha alpha: Any!)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
alphaalpha hex color in format AA
Return Value
new color
-
Create the color with individual hex colors and opacity
Declaration
Objective-C
- (instancetype)initWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andOpacity:(float)opacity;Swift
init!(hexRed red: Any!, andGreen green: Any!, andBlue blue: Any!, andOpacity opacity: Float)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
opacityopacity 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
alphaalpha 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
opacityopacity 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue float color inclusively between 0.0 and 1.0
opacityopacity 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
huehue
saturationsaturation
lightnesslightness
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
huehue
saturationsaturation
lightnesslightness
alphaalpha 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
colorcolor 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
colorcolor unsigned integer
Return Value
new color
-
Copy Initialize
Declaration
Objective-C
- (instancetype)initWithCLRColor:(CLRColor *)color;Swift
init!(clrColor color: CLRColor!)Parameters
colorcolor to copy
Return Value
new color
-
Set the color in hex
Declaration
Objective-C
- (void)setColorWithHex:(id)color;Swift
func setColorWithHex(_ color: Any!)Parameters
colorhex 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:(id)color andOpacity:(float)opacity;Swift
func setColorWithHex(_ color: Any!, andOpacity opacity: Float)Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
opacityopacity float inclusively between 0.0 and 1.0
-
Set the color in hex with an alpha
Declaration
Objective-C
- (void)setColorWithHex:(id)color andAlpha:(int)alpha;Swift
func setColorWithHex(_ color: Any!, andAlpha alpha: Int32)Parameters
colorhex color in format #RRGGBB, RRGGBB, #RGB, RGB, #AARRGGBB, AARRGGBB, #ARGB, or ARGB
alphaalpha integer color inclusively between 0 and 255
-
Set the color with individual hex colors
Declaration
Objective-C
- (void)setColorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue;Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
-
Set the color with individual hex colors and alpha
Declaration
Objective-C
- (void)setColorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andAlpha:(id)alpha;Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!, andAlpha alpha: Any!)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
alphaalpha hex color in format AA
-
Set the color with individual hex colors and opacity
Declaration
Objective-C
- (void)setColorWithHexRed:(id)red andGreen:(id)green andBlue:(id)blue andOpacity:(float)opacity;Swift
func setColorWithHexRed(_ red: Any!, andGreen green: Any!, andBlue blue: Any!, andOpacity opacity: Float)Parameters
redred hex color in format RR
greengreen hex color in format GG
blueblue hex color in format BB
opacityopacity 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
alphaalpha 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
redred integer color inclusively between 0 and 255
greengreen integer color inclusively between 0 and 255
blueblue integer color inclusively between 0 and 255
opacityopacity 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue 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
redred float color inclusively between 0.0 and 1.0
greengreen float color inclusively between 0.0 and 1.0
blueblue float color inclusively between 0.0 and 1.0
opacityopacity 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
huehue value inclusively between 0.0 and 360.0
saturationsaturation inclusively between 0.0 and 1.0
lightnesslightness 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
huehue value inclusively between 0.0 and 360.0
saturationsaturation inclusively between 0.0 and 1.0
lightnesslightness inclusively between 0.0 and 1.0
alphaalpha 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
colorcolor integer
-
Set the color as a single unsigned integer
Declaration
Objective-C
- (void)setUnsignedColor:(unsigned int)color;Swift
func setUnsigned(_ color: UInt32)Parameters
colorcolor unsigned integer
-
Set the red color in hex
Declaration
Objective-C
- (void)setRedHex:(id)red;Swift
func setRedHex(_ red: Any!)Parameters
redred hex color in format RR or R
-
Set the green color in hex
Declaration
Objective-C
- (void)setGreenHex:(id)green;Swift
func setGreenHex(_ green: Any!)Parameters
greengreen hex color in format GG or G
-
Set the blue color in hex
Declaration
Objective-C
- (void)setBlueHex:(id)blue;Swift
func setBlueHex(_ blue: Any!)Parameters
blueblue hex color in format BB or B
-
Set the alpha color in hex
Declaration
Objective-C
- (void)setAlphaHex:(id)alpha;Swift
func setAlphaHex(_ alpha: Any!)Parameters
alphaalpha 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
redred 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
greengreen 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
blueblue 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
alphaalpha 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
alphaalpha 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
- (id)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
- (id)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
- (id)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
- (id)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
- (id)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() -> Int32Return Value
integer color
-
Get the color as an unsigned integer
Declaration
Objective-C
- (unsigned int)unsignedColor;Swift
func unsignedColor() -> UInt32Return Value
unsigned integer color
-
Get the color as an integer including the alpha
Declaration
Objective-C
- (int)colorWithAlpha;Swift
func colorWithAlpha() -> Int32Return Value
integer color
-
Get the color as an unsigned integer including the alpha
Declaration
Objective-C
- (unsigned int)unsignedColorWithAlpha;Swift
func unsignedColorWithAlpha() -> UInt32Return Value
unsigned integer color
-
Get the red color in hex
Declaration
Objective-C
- (id)redHex;Swift
func redHex() -> Any!Return Value
red hex color in format RR
-
Get the green color in hex
Declaration
Objective-C
- (id)greenHex;Swift
func greenHex() -> Any!Return Value
green hex color in format GG
-
Get the blue color in hex
Declaration
Objective-C
- (id)blueHex;Swift
func blueHex() -> Any!Return Value
blue hex color in format BB
-
Get the alpha color in hex
Declaration
Objective-C
- (id)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
- (id)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
- (id)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
- (id)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
- (id)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() -> Int32Return Value
red integer color inclusively between 0 and 255
-
Get the green color as an integer
Declaration
Objective-C
- (int)green;Swift
func green() -> Int32Return Value
green integer color inclusively between 0 and 255
-
Get the blue color as an integer
Declaration
Objective-C
- (int)blue;Swift
func blue() -> Int32Return Value
blue integer color inclusively between 0 and 255
-
Get the alpha color as an integer
Declaration
Objective-C
- (int)alpha;Swift
func alpha() -> Int32Return 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() -> FloatReturn 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() -> FloatReturn Value
hue value
-
Get the HSL saturation value
Declaration
Objective-C
- (float)saturation;Swift
func saturation() -> FloatReturn Value
saturation value
-
Get the HSL lightness value
Declaration
Objective-C
- (float)lightness;Swift
func lightness() -> FloatReturn Value
lightness value
View on GitHub
CLRColor Class Reference