2023-07-26 06:35:11 +02:00
|
|
|
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
public extension View {
|
2023-07-27 07:48:59 +02:00
|
|
|
func foregroundColor(themeColor: ThemeValue) -> some View {
|
2023-07-26 09:02:11 +02:00
|
|
|
return self.foregroundColor(
|
2023-07-27 07:48:59 +02:00
|
|
|
ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
|
|
|
|
)
|
|
|
|
}
|
2023-08-16 05:43:33 +02:00
|
|
|
|
|
|
|
func backgroundColor(themeColor: ThemeValue) -> some View {
|
|
|
|
return self.background(
|
|
|
|
ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
|
|
|
|
)
|
|
|
|
}
|
2023-07-27 07:48:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public extension Shape {
|
|
|
|
func fill(themeColor: ThemeValue) -> some View {
|
|
|
|
return self.fill(
|
|
|
|
ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ?? Color.primary
|
2023-07-26 09:02:11 +02:00
|
|
|
)
|
|
|
|
}
|
2023-08-16 05:43:33 +02:00
|
|
|
|
2023-08-21 09:22:36 +02:00
|
|
|
func stroke(themeColor: ThemeValue, lineWidth: CGFloat = 1) -> some View {
|
2023-08-16 05:43:33 +02:00
|
|
|
return self.stroke(
|
2023-08-21 09:22:36 +02:00
|
|
|
ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ?? Color.primary,
|
|
|
|
lineWidth: lineWidth
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func stroke(themeColor: ThemeValue, style: StrokeStyle) -> some View {
|
|
|
|
return self.stroke(
|
|
|
|
ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ?? Color.primary,
|
|
|
|
style: style
|
2023-08-16 05:43:33 +02:00
|
|
|
)
|
|
|
|
}
|
2023-07-26 06:35:11 +02:00
|
|
|
}
|