From c0d0e6f6272ae1d0fcc2bb541f05228b55efb458 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 7 May 2024 13:29:47 -0500 Subject: [PATCH] added to look at the Color(name: after VDS Signed-off-by: Matt Bruce --- MVMCoreUI/CustomPrimitives/Color.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/CustomPrimitives/Color.swift b/MVMCoreUI/CustomPrimitives/Color.swift index 9245153d..678b845c 100644 --- a/MVMCoreUI/CustomPrimitives/Color.swift +++ b/MVMCoreUI/CustomPrimitives/Color.swift @@ -86,11 +86,14 @@ public final class Color: Codable { let colorString = try container.decode(String.self) if let vdsColor = UIColor.VDSColor(rawValue: colorString) { - self.uiColor = vdsColor.uiColor + uiColor = vdsColor.uiColor hex = uiColor.hexString ?? "" + } else if let color = Color(name: colorString) { + uiColor = color.uiColor + hex = color.hex } else { let components = try Color.getColorComponents(for: colorString) - self.uiColor = components.color + uiColor = components.color hex = components.hex name = components.name ?? "" }