toFluentColors

fun DynamicScheme.toFluentColors(): Colors

Builds Fluent Colors from this scheme's primary ramp.

FluentTheme(colors = scheme.toFluentColors()) {
Text("Themed from a seed colour")
}

Fluent builds light and dark from seven shades and a flag. lightColors and darkColors both call generateShades and differ only in the darkMode they pass on. This reads DynamicScheme.isDark for that flag, so a dark scheme always gives dark Fluent colors. From SPEC_2025 the scheme's primary ramp also changes between light and dark, so the shades differ as well.

Only the primary ramp is used. Fluent's success, caution and critical come from Colors.system, which is built from constants and has no setter a caller can reach, so a scheme's secondary, tertiary and error ramps have nowhere to go. Pass another ramp to toFluentShades yourself if you want a Fluent theme built on one of them.

The ramp this reads is the scheme's, which is not the same as the seed's own. A com.materialkolor.PaletteStyle reshapes chroma on the way through, so TonalSpot gives a calmer accent than the seed and Fidelity stays close to it. To get the seed exactly as it was handed over, skip the scheme.

val shades = TonalPalette.from(seedColor).toFluentShades()

Receiver

The scheme to take the primary ramp and the dark flag from.

Return

Colors to hand to FluentTheme.