rememberDynamicMaterialThemeState

fun rememberDynamicMaterialThemeState(seedColor: Color, isDark: Boolean, isAmoled: Boolean = false, primary: Color? = null, secondary: Color? = null, tertiary: Color? = null, neutral: Color? = null, neutralVariant: Color? = null, error: Color? = null, style: PaletteStyle = PaletteStyle.TonalSpot, contrastLevel: Double = Contrast.Default.value, extendedFidelity: Boolean = false, modifyColorScheme: DynamicMaterialThemeState.(ColorScheme) -> ColorScheme? = null): DynamicMaterialThemeState

Creates a DynamicMaterialThemeState that can be remembered across compositions using custom colors.

Parameters

seedColor

The initial seed color to generate the color scheme.

isDark

The initial dark mode state.

isAmoled

The initial Amoled state.

primary

A custom color to modify the primary color in the generated color scheme.

secondary

A custom color to modify the secondary color in the generated color scheme.

tertiary

A custom color to modify the tertiary color in the generated color scheme.

neutral

A custom color to modify the neutral color in the generated color scheme.

neutralVariant

A custom color to modify the neutral variant color in the generated color scheme.

error

A custom color to modify the error color in the generated color scheme.

style

The initial palette style.

contrastLevel

The initial contrast level.

extendedFidelity

The initial extended fidelity state.

modifyColorScheme

Use this callback to modify the color scheme once it has been generated. Note that if you modify a color in the scheme, the on* color might not have enough contrast.


fun rememberDynamicMaterialThemeState(primary: Color, isDark: Boolean, isAmoled: Boolean = false, secondary: Color? = null, tertiary: Color? = null, neutral: Color? = null, neutralVariant: Color? = null, error: Color? = null, style: PaletteStyle = PaletteStyle.TonalSpot, contrastLevel: Double = Contrast.Default.value, extendedFidelity: Boolean = false, modifyColorScheme: DynamicMaterialThemeState.(ColorScheme) -> ColorScheme? = null): DynamicMaterialThemeState

Creates a DynamicMaterialThemeState that can be remembered across compositions using custom colors.

Note: The primary color will be used as the seed color.

Parameters

primary

The initial seed color to generate the color scheme.

isDark

The initial dark mode state.

isAmoled

The initial Amoled state.

secondary

A custom color to modify the secondary color in the generated color scheme.

tertiary

A custom color to modify the tertiary color in the generated color scheme.

neutral

A custom color to modify the neutral color in the generated color scheme.

neutralVariant

A custom color to modify the neutral variant color in the generated color scheme.

error

A custom color to modify the error color in the generated color scheme.

style

The initial palette style.

contrastLevel

The initial contrast level.

extendedFidelity

The initial extended fidelity state.

modifyColorScheme

Use this callback to modify the color scheme once it has been generated. Note that if you modify a color in the scheme, the on* color might not have enough contrast.