mirror of
https://github.com/yattee/yattee.git
synced 2024-12-15 06:40:32 +05:30
16 lines
519 B
Swift
16 lines
519 B
Swift
import SwiftUI
|
|
|
|
extension Color {
|
|
#if os(macOS)
|
|
static let background = Color(NSColor.windowBackgroundColor)
|
|
static let secondaryBackground = Color(NSColor.controlBackgroundColor)
|
|
#elseif os(iOS)
|
|
static let background = Color(UIColor.systemBackground)
|
|
static let secondaryBackground = Color(UIColor.secondarySystemBackground)
|
|
#else
|
|
static func background(scheme: ColorScheme) -> Color {
|
|
scheme == .dark ? .black : .init(white: 0.8)
|
|
}
|
|
#endif
|
|
}
|