-
Parses the given 64 bits number, supporting 3, 4, 6 and 8 hexadecimal numbers.
Supported formats:
0x1230x123f0x1122330x112233cc
If the given value is greater than
0xFFFFFFFF,nilis returnedDeclaration
Swift
public convenience init?(hex: UInt64)Parameters
hexAlphanumeric RGBA color
-
Parses the given alphanumerical string, support 3, 4, 6 and 8 characters string, optionally prefixed by an hashtag.
Supported formats:
#123#123f#112233#112233cc
If none of the formats fit, or the string contains an invalid character,
nilis returned.Declaration
Swift
public convenience init?(hex: String)Parameters
hexAlphanumeric RGBA color string
-
Returns the hexadecimal representation of the color.
If the color has no alpha component, it will return a 6 letter string with a leading hash-tag, e.g.
#123456. If the alpha component is set, it will return a 8 letter string with a leading hash-tag, e.g.#123456abDeclaration
Swift
public var hex: String { get }
View on GitHub
RainbowColor Extension Reference