FlexTones.vividBackground constructor

FlexTones.vividBackground(
  1. Brightness brightness
)

Creates a tonal palette extraction setup that results in M3 like ColorsSchemes with chroma like FlexTones.vividSurfaces, but with a few minor adjustments for increased contrast in dark mode and no tinted surface color in light mode.

Surface color uses tone 100 (white) instead of standard 98 in light mode and 5 instead of 6 in dark mode, for a bit darker dark mode.

Chroma for neutral is 5 and neutralVariant 10, increased from M3 defaults 6 and 8.

NOTE:

Before version 3.10 the tone mappings of surface and background were just swapped, but since background color is gone in Flutter 3.22 and later, we needed to make a new setup that makes this tones setup be a bit different from the FlexTones.vividSurfaces setup.

Implementation

factory FlexTones.vividBackground(Brightness brightness) =>
    brightness == Brightness.light
        ? const FlexTones.light(
            primaryTone: 30,
            onPrimaryTone: 98,
            onSecondaryTone: 98,
            onTertiaryTone: 98,
            onErrorTone: 98,
            surfaceTone: 100,
            onSurfaceVariantTone: 20,
            inverseSurfaceTone: 30,
            surfaceTintTone: 30,
            //
            primaryMinChroma: 50,
            neutralChroma: 5,
            neutralVariantChroma: 10,
          )
        : const FlexTones.dark(
            onPrimaryTone: 10,
            onSecondaryTone: 10,
            onTertiaryTone: 10,
            primaryContainerTone: 20,
            surfaceTone: 5,
            onSurfaceVariantTone: 95,
            inverseSurfaceTone: 95,
            //
            primaryMinChroma: 50,
            neutralChroma: 5,
            neutralVariantChroma: 10,
          );