added to look at the Color(name: after VDS
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ddc1d5002c
commit
c0d0e6f627
@ -86,11 +86,14 @@ public final class Color: Codable {
|
|||||||
let colorString = try container.decode(String.self)
|
let colorString = try container.decode(String.self)
|
||||||
|
|
||||||
if let vdsColor = UIColor.VDSColor(rawValue: colorString) {
|
if let vdsColor = UIColor.VDSColor(rawValue: colorString) {
|
||||||
self.uiColor = vdsColor.uiColor
|
uiColor = vdsColor.uiColor
|
||||||
hex = uiColor.hexString ?? ""
|
hex = uiColor.hexString ?? ""
|
||||||
|
} else if let color = Color(name: colorString) {
|
||||||
|
uiColor = color.uiColor
|
||||||
|
hex = color.hex
|
||||||
} else {
|
} else {
|
||||||
let components = try Color.getColorComponents(for: colorString)
|
let components = try Color.getColorComponents(for: colorString)
|
||||||
self.uiColor = components.color
|
uiColor = components.color
|
||||||
hex = components.hex
|
hex = components.hex
|
||||||
name = components.name ?? ""
|
name = components.name ?? ""
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user