mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
44 lines
661 B
Swift
44 lines
661 B
Swift
// Copyright 2021 Yandex LLC. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
import BaseUI
|
|
|
|
@frozen
|
|
public enum Theme: String {
|
|
case dark
|
|
case light
|
|
}
|
|
|
|
extension Theme {
|
|
public var userInterfaceStyle: UserInterfaceStyle {
|
|
switch self {
|
|
case .light:
|
|
return .light
|
|
case .dark:
|
|
return .dark
|
|
}
|
|
}
|
|
|
|
@available(iOS 13, macOS 10.15, *)
|
|
public var colorScheme: ColorScheme {
|
|
switch self {
|
|
case .light:
|
|
return .light
|
|
case .dark:
|
|
return .dark
|
|
}
|
|
}
|
|
}
|
|
|
|
extension UserInterfaceStyle {
|
|
public var theme: Theme {
|
|
switch self {
|
|
case .light:
|
|
return .light
|
|
case .dark:
|
|
return .dark
|
|
}
|
|
}
|
|
}
|