diff --git a/MVMCoreUI/CustomPrimitives/Color.swift b/MVMCoreUI/CustomPrimitives/Color.swift index b251f778..9245153d 100644 --- a/MVMCoreUI/CustomPrimitives/Color.swift +++ b/MVMCoreUI/CustomPrimitives/Color.swift @@ -84,10 +84,17 @@ public final class Color: Codable { required public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() let colorString = try container.decode(String.self) - let components = try Color.getColorComponents(for: colorString) - self.uiColor = components.color - hex = components.hex - name = components.name ?? "" + + if let vdsColor = UIColor.VDSColor(rawValue: colorString) { + self.uiColor = vdsColor.uiColor + hex = uiColor.hexString ?? "" + } else { + let components = try Color.getColorComponents(for: colorString) + self.uiColor = components.color + hex = components.hex + name = components.name ?? "" + } + determineRGBA() }