UIColor
public extension UIColor
Extension for UIColor functionality.
-
Extends the functionality of a UIColor with the ability to init it with hex string.
Declaration
Swift
convenience init(hexString: String)Parameters
hexStringThe String Object. The hex string to init UIColor.
-
Extends the functionality of a UIColor with the ability to convert it to hex string.
Declaration
Swift
func toHexString() -> StringReturn Value
The String Object that contains a color in hex format.
-
Extends the functionality of a UIColor with the ability to use color asset for all iOS Versions, iOS 13+ by name and older by base color.
Declaration
Swift
static func colorAsset(name colorAssetName: String, baseColor: UIColor, aboveiOS11Mock: Bool = true) -> UIColorParameters
colorAssetNameThe String Object. The name for color asset used for dark mode in iOS 13 and higher.
baseColorThe UIColor Object. The color used as base color for iOS versions below iOS 13.
Return Value
The UIColor Object.
UIColor Extension Reference