PaletteStyle

sealed interface PaletteStyle

The style of the palette to generate.

Mapped to Variant in the Material Design guidelines.

toString() is a stable round trip format you can put in a URL, a preference or a database column, the way Duration and Uuid do it. parse(style.toString()) gives back an equal style for every style, and parseOrNull answers null instead of throwing when the text came from somewhere else.

Every style except Cmf writes its name. A Cmf with no tertiary seed color writes "Cmf", and one that carries a seed writes Cmf:AARRGGBB, eight uppercase hex digits read through toArgb, so a wide gamut seed collapses to its sRGB eight bit form and comes back in sRGB.

Inheritors

Types

Link copied to clipboard
class Cmf(val tertiarySeedColor: Color? = null) : PaletteStyle

A theme using the 2026 spec's CMF (Color, Material, Finish) variant, which accepts two seed colors.

Link copied to clipboard
object Companion
Link copied to clipboard
data object Content : PaletteStyle

A scheme that places the source color in Scheme.primaryContainer.

Link copied to clipboard
data object Expressive : PaletteStyle

A playful theme - the source color's hue does not appear in the theme.

Link copied to clipboard
data object Fidelity : PaletteStyle

A scheme that places the source color in Scheme.primaryContainer.

Link copied to clipboard
data object FruitSalad : PaletteStyle

A playful theme - the source color's hue does not appear in the theme.

Link copied to clipboard
data object Monochrome : PaletteStyle

A monochrome theme, colors are purely black / white / gray.

Link copied to clipboard
data object Neutral : PaletteStyle

A theme that's slightly more chromatic than monochrome, which is purely black / white / gray.

Link copied to clipboard
data object Rainbow : PaletteStyle

A playful theme - the source color's hue does not appear in the theme.

Link copied to clipboard
data object TonalSpot : PaletteStyle

A calm theme, sedated colors that aren't particularly chromatic.

Link copied to clipboard
data object Vibrant : PaletteStyle

A loud theme, colorfulness is maximum for Primary palette, increased for others.

Properties

Link copied to clipboard
open val name: String

Stable identifier for the style, matching the entry names the old enum had. Cmf is always "Cmf" no matter which seed it carries, so use toString() when the seed must survive.