Color
#color #colorpalette #gradient #lineargradient
Overview
Changing the Color Scheme
.environment(.colorScheme, .dark)Changing the Toolbar Color Scheme
.toolbarColorScheme(.dark, for: .navigationBar)Sources
Detecting the Color Chema
struct ContentView: View {
@Environment(\.colorScheme) var colorScheme
var body: some View {
Text(colorScheme == .dark ? "In dark mode" : "In light mode")
}
}Sources
Adding ternary conditional into the color code
Color Palette
.foregroundColor vs .foregroundStyle
LinearGradient()
Sample Codes
Sources
Videos
Articles / Documents
Last updated