rememberDynamicLightDarkColors
Generates a light and a dark scheme from seedColor and remembers the token values of each.
The result is a value for a theme property, so your theme decides where it goes. Put the light colors in the base values and the dark colors in the com.composeunstyled.theme.ColorScheme.Dark block, next to anything else that scheme changes.
val AppTheme = buildThemeV2 {
// Set this property to enable color transitions.
colorSchemeTransitionSpec = tween(300)
val (light, dark) = rememberDynamicLightDarkColors(seedColor = seed)
properties[MaterialKolorTokens.colors] = light
colorScheme(ColorScheme.Dark) {
properties[MaterialKolorTokens.colors] = dark
}
}Base values are the fallback for every color scheme that does not set the property, so the light colors also cover com.composeunstyled.theme.ColorScheme.Light and any scheme of your own that leaves colors alone.
The parameters are the ones rememberDynamicScheme takes, minus isDark which the two schemes own.
Return
The remembered token values, light first and dark second.
Parameters
The color to base the schemes on.
The primary color of the schemes.
The secondary color of the schemes.
The tertiary color of the schemes.
The neutral color of the schemes.
The neutral variant color of the schemes.
The error color of the schemes.
The style of the schemes.
The contrast level of the schemes.
The version of the color specification to use.
The platform to use for the schemes.