Commit c217102c by Orkhan Alikhanov

Added applyCurrentTheme for Themeables

parent a14404fe
...@@ -89,9 +89,10 @@ public extension Theme { ...@@ -89,9 +89,10 @@ public extension Theme {
static var dark: Theme = { static var dark: Theme = {
var t = Theme() var t = Theme()
t.primary = UIColor(rgb: 0x202020) t.primary = UIColor(rgb: 0x202020)
t.secondary = UIColor(rgb: 0x33776B) t.secondary = Color.teal.base
t.background = UIColor(rgb: 0x303030) t.background = UIColor(rgb: 0x303030)
t.onBackground = .white t.onBackground = .white
t.onSurface = .white
return t return t
}() }()
} }
...@@ -175,4 +176,13 @@ public extension Themeable where Self: NSObject { ...@@ -175,4 +176,13 @@ public extension Themeable where Self: NSObject {
AssociatedObject.set(base: self, key: &IsThemingEnabledKey, value: value) AssociatedObject.set(base: self, key: &IsThemingEnabledKey, value: value)
} }
} }
/// Applies current theme to itself if theming is enabled.
internal func applyCurrentTheme() {
guard isThemingEnabled else {
return
}
apply(theme: .current)
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment