HexColor
public struct HexColor : Codable
Represents a color in hexadecimal notation. This type provides compatibility with the Codable protocol
for color objects.
-
The raw string value of the hex color code.
Declaration
Swift
public let rawValue: String -
The
UIColorrepresentation of the hex color code.Declaration
Swift
public let color: UIColor -
Creates a hex color code from a given
UIColorvalue.Declaration
Swift
public init(_ color: UIColor)Parameters
colorThe color represented by
UIColor. -
Creates a hex color code from a given string. If the string does not represent a valid color,
defaultis used.Declaration
Swift
public init(rawValue: String, default: UIColor)Parameters
rawValueThe raw string representation of the hex color code.
defaultThe fallback color used to create the hex color code when a color cannot be created with
rawValue.
View on GitHub
HexColor Structure Reference