Skip to content

Instantly share code, notes, and snippets.

@dllewellyn
Created January 9, 2021 11:23
Show Gist options
  • Select an option

  • Save dllewellyn/c9ea780c2000e34cf3ca7ea3ca6e5af6 to your computer and use it in GitHub Desktop.

Select an option

Save dllewellyn/c9ea780c2000e34cf3ca7ea3ca6e5af6 to your computer and use it in GitHub Desktop.
private val DarkColorPalette = darkColors(
primary = purple200,
primaryVariant = purple700,
secondary = teal200
)
private val LightColorPalette = lightColors(
primary = purple500,
primaryVariant = purple700,
secondary = teal200
/* Other default colors to override
background = Color.White,
surface = Color.White,
onPrimary = Color.White,
onSecondary = Color.Black,
onBackground = Color.Black,
onSurface = Color.Black,
*/
)
@Composable
fun MyApplicationTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable() () -> Unit) {
val colors = if (darkTheme) {
DarkColorPalette
} else {
LightColorPalette
}
MaterialTheme(
colors = colors,
typography = typography,
shapes = shapes,
content = content
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment