DynamicMaterialTheme

fun DynamicMaterialTheme(seedColor: Color, useDarkTheme: Boolean = isSystemInDarkTheme(), withAmoled: 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, shapes: Shapes = MaterialTheme.shapes, typography: Typography = MaterialTheme.typography, isExtendedFidelity: Boolean = false, animate: Boolean = false, animationSpec: AnimationSpec<Color> = spring(stiffness = Spring.StiffnessLow), content: @Composable () -> Unit)

A Material Theme that adapts to the given seed color and the provided custom colors.

You can access the current seed color via LocalDynamicMaterialThemeSeed.

Parameters

seedColor

The seed color to use for generating the color scheme.

useDarkTheme

Whether to use a dark theme or not.

withAmoled

Whether the dark scheme is used with Amoled screen (Pure dark).

primary

The custom primary color of the color scheme.

secondary

The custom secondary color of the color scheme.

tertiary

The custom tertiary color of the color scheme.

neutral

The custom neutral color of the color scheme.

neutralVariant

The custom neutral variant color of the color scheme.

error

The custom error color of the color scheme.

style

The style of the color scheme.

contrastLevel

The contrast level of the color scheme.

isExtendedFidelity

Whether to use the extended fidelity color set. See MaterialDynamicColors.

animate

Whether to animate the color scheme or not.

animationSpec

The animation spec to use for animating the color scheme.

content

The Composable content of the theme.

See also


fun DynamicMaterialTheme(primary: Color, useDarkTheme: Boolean = isSystemInDarkTheme(), withAmoled: 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, shapes: Shapes = MaterialTheme.shapes, typography: Typography = MaterialTheme.typography, isExtendedFidelity: Boolean = false, animate: Boolean = false, animationSpec: AnimationSpec<Color> = spring(stiffness = Spring.StiffnessLow), content: @Composable () -> Unit)

A Material Theme that adapts to the given seed color and the provided custom colors.

You can access the current seed color via LocalDynamicMaterialThemeSeed.

Parameters

primary

The primary color of the color scheme.

useDarkTheme

Whether to use a dark theme or not.

withAmoled

Whether the dark scheme is used with Amoled screen (Pure dark).

secondary

The custom secondary color of the color scheme.

tertiary

The custom tertiary color of the color scheme.

neutral

The custom neutral color of the color scheme.

neutralVariant

The custom neutral variant color of the color scheme.

error

The custom error color of the color scheme.

style

The style of the color scheme.

contrastLevel

The contrast level of the color scheme.

isExtendedFidelity

Whether to use the extended fidelity color set. See MaterialDynamicColors.

animate

Whether to animate the color scheme or not.

animationSpec

The animation spec to use for animating the color scheme.

content

The Composable content of the theme.

See also


fun DynamicMaterialTheme(state: DynamicMaterialThemeState, shapes: Shapes = MaterialTheme.shapes, typography: Typography = MaterialTheme.typography, animate: Boolean = false, animationSpec: AnimationSpec<Color> = spring(stiffness = Spring.StiffnessLow), content: @Composable () -> Unit)

A Material Theme that adapts to the given DynamicMaterialThemeState.seedColor.

You can access the current seed color via LocalDynamicMaterialThemeSeed.

Parameters

state

The state of the dynamic material theme.

animate

Whether to animate the color scheme or not.

animationSpec

The animation spec to use for animating the color scheme.

content

The Composable content of the theme.

See also