mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Swift
		
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Swift
		
	
| // Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
 | |
| 
 | |
| import SwiftUI
 | |
| 
 | |
| public extension View {
 | |
|     func foregroundColor(themeColor: ThemeValue) -> some View {
 | |
|         return self.foregroundColor(
 | |
|             ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
 | |
|         )
 | |
|     }
 | |
|     
 | |
|     func backgroundColor(themeColor: ThemeValue) -> some View {
 | |
|         if #available(iOSApplicationExtension 14.0, *) {
 | |
|             return self.background(
 | |
|                 ThemeManager.currentTheme.colorSwiftUI(for: themeColor)?.ignoresSafeArea()
 | |
|             )
 | |
|         } else {
 | |
|             return self.background(
 | |
|                 ThemeManager.currentTheme.colorSwiftUI(for: themeColor)
 | |
|             )
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| public extension Shape {
 | |
|     func fill(themeColor: ThemeValue) -> some View {
 | |
|         return self.fill(
 | |
|             ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ?? Color.primary
 | |
|         )
 | |
|     }
 | |
|     
 | |
|     func stroke(themeColor: ThemeValue, lineWidth: CGFloat = 1) -> some View {
 | |
|         return self.stroke(
 | |
|             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
 | |
|         )
 | |
|     }
 | |
| }
 |