ColorRepresentation
public enum ColorRepresentation : ExpressibleByIntegerLiteral, ExpressibleByArrayLiteral, ExpressibleByStringLiteral
An easy way to represent colors through hex, RGB, and RGBA values.
-
Declaration
Swift
public typealias IntegerLiteralType = Int
-
Undocumented
Declaration
Swift
public typealias Element = Float
-
Declaration
Swift
public typealias UnicodeScalarLiteralType = StringLiteralType
-
Declaration
Swift
public typealias ExtendedGraphemeClusterLiteralType = StringLiteralType
-
Declaration
Swift
public typealias StringLiteralType = String
-
A representation of a hexadecimal-encoded color
Declaration
Swift
case HEX(Int)
-
A representation of a RGB-encoded color
Declaration
Swift
case RGB(Int, Int, Int)
-
A representation of a RGB-encoded color, with an alpha value
Declaration
Swift
case RGBA(Int, Int, Int, Float)
-
An invalid color
Declaration
Swift
case invalid
-
Creates a
ColorRepresentation
with the provided hexadecimal value.let red: ColorRepresentation = 0xFF0000
See also
UIColor.init(_:)
Declaration
Swift
public init(integerLiteral value: IntegerLiteralType)
-
Creates a
ColorRepresentation
from 3 or 4 integer parameters.let red: ColorRepresentation = [255, 0, 0]
See also
UIColor.init(_:)
Declaration
Swift
public init(arrayLiteral elements: Element...)
-
Undocumented
Declaration
Swift
public init(from string: String)
-
Declaration
Swift
public init(stringLiteral value: StringLiteralType)
-
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType)
-
Declaration
Swift
public init(unicodeScalarLiteral value: UnicodeScalarLiteralType)