RSDColorTile
public struct RSDColorTile : Codable, Equatable, Hashable
A color tile is a single color and whether or not that color uses light style.
-
The color defined for this tile.
Declaration
Swift
public let color: RSDColor
-
Hint for whether or not the view uses light style for things like the progress bar, text, and navigation buttons shown on top of this color. This is used primarily to denote whether or not the color is
light
ordark
, where a dark color showing white text would setusesLightStyle = true
and a light color showing dark text would setusesLightStyle = false
.Declaration
Swift
public let usesLightStyle: Bool
-
The color name (hex code, special, or asset) used to decode the color from a color file.
Declaration
Swift
public let colorName: String?
-
Initialize from a color and light style.
Declaration
Swift
public init(_ color: RSDColor, usesLightStyle: Bool)
-
Initialize from a decoder.
- example:
// Example JSON dictionary that includes a spoken instruction map. let json = """ { "color": "#5A478F", "usesLightStyle": false } """.data(using: .utf8)! // our data in native (JSON) format
Declaration
Swift
public init(from decoder: Decoder) throws
- example:
-
Encode the color tile where the color is encoded as RGB.
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public static func == (lhs: RSDColorTile, rhs: RSDColorTile) -> Bool