diff --git a/VDS/Components/Toggle/VDSToggle.swift b/VDS/Components/Toggle/VDSToggle.swift index 34a6c275..c569597f 100644 --- a/VDS/Components/Toggle/VDSToggle.swift +++ b/VDS/Components/Toggle/VDSToggle.swift @@ -377,7 +377,7 @@ import Combine }, completion: nil) } - backgroundColor = viewModel.surface == .dark ? VDSColor.backgroundPrimaryDark : .clear + backgroundColor = viewModel.surface.color isUserInteractionEnabled = !viewModel.disabled setAccessibilityHint(enabled) diff --git a/VDS/Protocols/Surfaceable.swift b/VDS/Protocols/Surfaceable.swift index 4988a146..c00fd04c 100644 --- a/VDS/Protocols/Surfaceable.swift +++ b/VDS/Protocols/Surfaceable.swift @@ -6,9 +6,14 @@ // import Foundation +import UIKit +import VDSColorTokens public enum Surface: String, Codable { case light, dark + public var color: UIColor { + return self == .dark ? VDSColor.backgroundPrimaryDark : .clear + } } public protocol Surfaceable {