Declared in UIColor+BFKit.h

Overview

This category adds some useful methods to UIColor

RGBA(r, g, b, a): Create an UIColor in format RGBA

RBG(r, g, b): Create an UIColor in format RGB

Tasks

Properties

alpha

@property (nonatomic, readonly) CGFloat alpha
Discussion

RGB properties: alpha

Declared In

UIColor+BFKit.h

blue

@property (nonatomic, readonly) CGFloat blue
Discussion

RGB properties: blue

Declared In

UIColor+BFKit.h

brightness

@property (nonatomic, readonly) CGFloat brightness
Discussion

RGB properties: brightness

Declared In

UIColor+BFKit.h

green

@property (nonatomic, readonly) CGFloat green
Discussion

RGB properties: green

Declared In

UIColor+BFKit.h

hue

@property (nonatomic, readonly) CGFloat hue
Discussion

RGB properties: hue

Declared In

UIColor+BFKit.h

luminance

@property (nonatomic, readonly) CGFloat luminance
Discussion

RGB properties: luminance

Declared In

UIColor+BFKit.h

red

@property (nonatomic, readonly) CGFloat red
Discussion

RGB properties: red

Declared In

UIColor+BFKit.h

saturation

@property (nonatomic, readonly) CGFloat saturation
Discussion

RGB properties: saturation

Declared In

UIColor+BFKit.h

white

@property (nonatomic, readonly) CGFloat white
Discussion

RGB properties: white

Declared In

UIColor+BFKit.h

Class Methods

colorForColorString:

+ (UIColor *_Nonnull)colorForColorString:(NSString *_Nonnull)colorString
Discussion

Create an UIColor from a given string (blue or ff00ff)

Parameters

colorString

String with the color

Return Value

Returns the created UIColor

Declared In

UIColor+BFKit.h

colorWithColor:alpha:

+ (UIColor *_Nonnull)colorWithColor:(UIColor *_Nonnull)color alpha:(float)alpha
Discussion

Creates and returns a color object that has the same color space and component values as the given color, but has the specified alpha component

Parameters

color

UIColor value

alpha

Alpha value

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

colorWithHex:

+ (UIColor *_Nonnull)colorWithHex:(unsigned int)hex
Discussion

Create a color from HEX

Parameters

hex

HEX value

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

colorWithHex:alpha:

+ (UIColor *_Nonnull)colorWithHex:(unsigned int)hex alpha:(float)alpha
Discussion

Create a color from HEX with alpha

Parameters

hex

HEX value

alpha

Alpha value

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

colorWithHexString:

+ (UIColor *_Nonnull)colorWithHexString:(NSString *_Nonnull)hexString
Discussion

Create a color from a HEX string

Parameters

hexString

HEX string

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

hex:

+ (UIColor *_Nonnull)hex:(NSString *_Nonnull)hexString
Discussion

Create a color from a HEX string. It supports the following type: - #RGB - #ARGB - #RRGGBB - #AARRGGBB

Parameters

hex

HEX string

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

hexString:

+ (UIColor *_Nonnull)hexString:(NSString *_Nonnull)hexString
Discussion

Create a color from a HEX string. It supports the following type: - #RGB - #ARGB - #RRGGBB - #AARRGGBB

Parameters

hexString

HEX string

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

randomColor

+ (UIColor *_Nonnull)randomColor
Discussion

Create a random color

Return Value

Returns the UIColor instance

Declared In

UIColor+BFKit.h

Instance Methods

canProvideRGBComponents

- (BOOL)canProvideRGBComponents
Discussion

Check if the color is in RGB format

Return Value

Returns if the color is in RGB format

Declared In

UIColor+BFKit.h

complementaryColor

- (UIColor *_Nonnull)complementaryColor
Discussion

A complementary color that should look good

Return Value

Returns the color

Declared In

UIColor+BFKit.h

contrastingColor

- (UIColor *_Nonnull)contrastingColor
Discussion

A good contrasting color, it will be either black or white

Return Value

Returns the color

Declared In

UIColor+BFKit.h