From 87b3fd5792cf82bfc8076330665afc01a02e40f7 Mon Sep 17 00:00:00 2001 From: Jeong Chong In Date: Tue, 26 Dec 2023 20:29:13 +0900 Subject: [PATCH] =?UTF-8?q?[#254]=20dark=20mode=20color=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YDS-SwiftUI/Source/Foundation/YDSSemanticColor.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/YDS-SwiftUI/Source/Foundation/YDSSemanticColor.swift b/YDS-SwiftUI/Source/Foundation/YDSSemanticColor.swift index 0ddad393..fb1f1591 100644 --- a/YDS-SwiftUI/Source/Foundation/YDSSemanticColor.swift +++ b/YDS-SwiftUI/Source/Foundation/YDSSemanticColor.swift @@ -6,14 +6,10 @@ // import SwiftUI -public enum YDSColor { +public struct YDSColor { private static func color(light: Color, dark: Color? = nil) -> Color { if let dark = dark { - if UITraitCollection.current.userInterfaceStyle == .dark { - return dark - } else { - return light - } + return Color(uiColor: UIColor { $0.userInterfaceStyle == .dark ? UIColor(dark) : UIColor(light) }) } else { return light }