-
-
Save sturdysturge/0bc71b8eccef992809d42ce5a978aa66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ColourSchemeSection: View { | |
let colourScheme: ColorScheme | |
var colourSchemeName: String { | |
colourScheme == .dark ? "Dark" : "Light" | |
} | |
var body: some View { | |
Section("\(colourSchemeName) Colour Scheme") { | |
Text("Primary Foreground, Secondary Background") | |
.foregroundColor(.primary) | |
.background(Color.secondary) | |
Text("Secondary Foreground, Primary Background") | |
.foregroundColor(.secondary) | |
.background(Color.primary) | |
} | |
.preferredColorScheme(colourScheme) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment