FlexTones.material constructor

FlexTones.material(
  1. Brightness brightness
)

Create a Material-3 standard tonal palette tones extraction using HCT based chroma.

This setup will if only one seed color is used, produce the same result as Flutter SDK does when using ColorScheme.fromSeed in Flutter version 3.22 and later.

Prior to Flutter 3.22 the paletteType was FlexPaletteType.common and the useCam16 was true, primaryChroma was 48 (now 36) and neutral chroma 8 (now 6). These changed value match the new Material-3 defaults in Flutter 3.22 and later.

It should be noted that the Material-3 implementation in Flutter uses DynamicSchemeVariant tonalSpot as default for the Material-3 design seed generated ColorScheme. There might be some slight differences in its results and using this selection in some edge cases, but none have been observed in normal use cases. If an exact match is critical, use tonalSpot as used in the Flutter SDK 3.22 and later.

If you want to use multiple seed colors to generate a ColorScheme, you will need to use FlexTones based configurations, the ones based on Flutter SDK DynamicSchemeVariant and MCU do not provide that feature-set.

Implementation

factory FlexTones.material(Brightness brightness) =>
    brightness == Brightness.light
        ? const FlexTones.light(
            primaryChroma: 36,
            primaryMinChroma: 36,
            secondaryChroma: 16,
            tertiaryChroma: 24,
            useCam16: false,
          )
        : const FlexTones.dark(
            primaryChroma: 36,
            primaryMinChroma: 36,
            secondaryChroma: 16,
            tertiaryChroma: 24,
            useCam16: false,
          );