Skip to content

Instantly share code, notes, and snippets.

@Karn
Last active March 9, 2025 04:26
Show Gist options
  • Save Karn/df20438487e2a1ed00561c39ad59e78a to your computer and use it in GitHub Desktop.
Save Karn/df20438487e2a1ed00561c39ad59e78a to your computer and use it in GitHub Desktop.
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment