FlexTones.light constructor
- int primaryTone = 40,
- int onPrimaryTone = 100,
- int primaryContainerTone = 90,
- int onPrimaryContainerTone = 10,
- int primaryFixedTone = 90,
- int primaryFixedDimTone = 80,
- int onPrimaryFixedTone = 10,
- int onPrimaryFixedVariantTone = 30,
- int secondaryTone = 40,
- int onSecondaryTone = 100,
- int secondaryContainerTone = 90,
- int onSecondaryContainerTone = 10,
- int secondaryFixedTone = 90,
- int secondaryFixedDimTone = 80,
- int onSecondaryFixedTone = 10,
- int onSecondaryFixedVariantTone = 30,
- int tertiaryTone = 40,
- int onTertiaryTone = 100,
- int tertiaryContainerTone = 90,
- int onTertiaryContainerTone = 10,
- int tertiaryFixedTone = 90,
- int tertiaryFixedDimTone = 80,
- int onTertiaryFixedTone = 10,
- int onTertiaryFixedVariantTone = 30,
- int errorTone = 40,
- int onErrorTone = 100,
- int errorContainerTone = 90,
- int onErrorContainerTone = 10,
- int surfaceTone = 98,
- int surfaceDimTone = 87,
- int surfaceBrightTone = 98,
- int surfaceContainerLowestTone = 100,
- int surfaceContainerLowTone = 96,
- int surfaceContainerTone = 94,
- int surfaceContainerHighTone = 92,
- int surfaceContainerHighestTone = 90,
- int onSurfaceTone = 10,
- int onSurfaceVariantTone = 30,
- int inverseSurfaceTone = 20,
- int onInverseSurfaceTone = 95,
- int inversePrimaryTone = 80,
- int surfaceTintTone = 40,
- int outlineTone = 50,
- int outlineVariantTone = 80,
- int shadowTone = 0,
- int scrimTone = 0,
- @Deprecated('Use surfaceTone instead.') int? backgroundTone,
- @Deprecated('Use onSurfaceTone instead.') int? onBackgroundTone,
- @Deprecated('Use surfaceContainerHighestTone instead.') int? surfaceVariantTone,
- double? primaryChroma,
- double? primaryMinChroma,
- double? secondaryChroma,
- double? secondaryMinChroma,
- double? tertiaryChroma,
- double? tertiaryMinChroma,
- double? tertiaryHueRotation,
- double? errorChroma,
- double? errorMinChroma,
- double? neutralChroma = 6,
- double? neutralMinChroma,
- double? neutralVariantChroma = 8,
- double? neutralVariantMinChroma,
- FlexPaletteType paletteType = FlexPaletteType.extended,
- bool useCam16 = true,
Create an M3 light theme mode tonal palette tones extraction setup.
This setup is almost identical to the default that you get if only
one seed color is used, as you get with Flutter when it uses
Scheme.light and ColorPalette.of
. The difference is
that it does not lock the chroma values for primary, secondary and
tertiary to a specific chroma value, but uses actual chroma of specified
key color, as long as it is over the minimum value.
The minimum values match the Material-3 defaults.
To get the an exact matching setup as used by Material-3 ColorScheme.fromSeed use the FlexTones.material factory as the FlexTones configuration.
The default chroma limits for neutral and neutral variant key colors are
set to 6 and 8 as in Material-3 design. You can create a
FlexTones.light where you set neutralChroma
and neutralVariantChroma
to use the effective chroma values in their seed key values as the actual
chroma value for the neutral and neutral tonal palette generation.
This is usually not a good idea, as the seeds value then have to be
pre-tuned to have suitable chroma for neutral surfaces with hint of the
intended low colorfulness. If using key colors to seed generated neutral
colors with other than primary base, it is recommended to set the chroma
values for neutrals to fixed values to get good predictable surface
colors. Limits from 2 to 12 are recommended, with the higher range more
suitable for the neutral variant.
After FSS version 3.1.0 any mappings for background, onBackground and surfaceVariant are ignored. The colors are deprecated in Flutter 3.22 and no longer colors that should be used.
Implementation
const FlexTones.light({
this.primaryTone = 40,
this.onPrimaryTone = 100,
this.primaryContainerTone = 90,
this.onPrimaryContainerTone = 10,
this.primaryFixedTone = 90,
this.primaryFixedDimTone = 80,
this.onPrimaryFixedTone = 10,
this.onPrimaryFixedVariantTone = 30,
//
this.secondaryTone = 40,
this.onSecondaryTone = 100,
this.secondaryContainerTone = 90,
this.onSecondaryContainerTone = 10,
this.secondaryFixedTone = 90,
this.secondaryFixedDimTone = 80,
this.onSecondaryFixedTone = 10,
this.onSecondaryFixedVariantTone = 30,
//
this.tertiaryTone = 40,
this.onTertiaryTone = 100,
this.tertiaryContainerTone = 90,
this.onTertiaryContainerTone = 10,
this.tertiaryFixedTone = 90,
this.tertiaryFixedDimTone = 80,
this.onTertiaryFixedTone = 10,
this.onTertiaryFixedVariantTone = 30,
//
this.errorTone = 40,
this.onErrorTone = 100,
this.errorContainerTone = 90,
this.onErrorContainerTone = 10,
//
this.surfaceTone = 98,
this.surfaceDimTone = 87,
this.surfaceBrightTone = 98,
this.surfaceContainerLowestTone = 100,
this.surfaceContainerLowTone = 96,
this.surfaceContainerTone = 94,
this.surfaceContainerHighTone = 92,
this.surfaceContainerHighestTone = 90,
this.onSurfaceTone = 10,
this.onSurfaceVariantTone = 30,
//
this.inverseSurfaceTone = 20,
this.onInverseSurfaceTone = 95,
this.inversePrimaryTone = 80,
this.surfaceTintTone = 40,
//
this.outlineTone = 50,
this.outlineVariantTone = 80,
this.shadowTone = 0,
this.scrimTone = 0,
// Deprecated tones
@Deprecated('Use surfaceTone instead.') this.backgroundTone,
@Deprecated('Use onSurfaceTone instead.') this.onBackgroundTone,
@Deprecated('Use surfaceContainerHighestTone instead.')
this.surfaceVariantTone,
//
this.primaryChroma,
this.primaryMinChroma,
this.secondaryChroma,
this.secondaryMinChroma,
this.tertiaryChroma,
this.tertiaryMinChroma,
this.tertiaryHueRotation,
this.errorChroma,
this.errorMinChroma,
this.neutralChroma = 6,
this.neutralMinChroma,
this.neutralVariantChroma = 8,
this.neutralVariantMinChroma,
this.paletteType = FlexPaletteType.extended,
this.useCam16 = true,
});