UIColor
public extension UIColor
-
Initializes and returns a random color object using the specified opacity and RGB component values.
Declaration
Swift
static var random: UIColor { get } -
Initializes and returns a random color object using the specified opacity and RGB component values in the Display P3 color space.
Declaration
Swift
static var p3Random: UIColor { get }
-
Possible errors for UIColor Hexadecimal extension
See moreDeclaration
Swift
enum HexCodeError : Error -
Initializes a new
UIColorfrom itsHexadecimalrepresentation.Throws
HexCodeError.Declaration
Swift
convenience init(hex code: String) throwsParameters
codeThe
Hexadecimalrepresentation from which to extract the code.
-
Initializes a UIColor from an array of CGFloat components if possible, otherwise returns nil.
Declaration
Swift
convenience init?(components: [CGFloat]?)Parameters
componentsThe components making up the UIColor. Either [red, green, blue] or [red, green, blue, alpha].
View on GitHub
UIColor Extension Reference