mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-13 06:49:23 +00:00
22 lines
1.0 KiB
Swift
22 lines
1.0 KiB
Swift
import Foundation
|
|
import UIKit
|
|
import TelegramUIPreferences
|
|
|
|
public func makePresentationTheme(themeReference: PresentationThemeReference, accentColor: UIColor, serviceBackgroundColor: UIColor, preview: Bool = false) -> PresentationTheme {
|
|
let theme: PresentationTheme
|
|
switch themeReference {
|
|
case let .builtin(reference):
|
|
switch reference {
|
|
case .dayClassic:
|
|
theme = makeDefaultDayPresentationTheme(serviceBackgroundColor: serviceBackgroundColor, day: false, preview: preview)
|
|
case .night:
|
|
theme = makeDarkPresentationTheme(accentColor: accentColor, preview: preview)
|
|
case .nightAccent:
|
|
theme = makeDarkAccentPresentationTheme(accentColor: accentColor, preview: preview)
|
|
case .day:
|
|
theme = makeDefaultDayPresentationTheme(accentColor: accentColor, serviceBackgroundColor: serviceBackgroundColor, day: true, preview: preview)
|
|
}
|
|
}
|
|
return theme
|
|
}
|