FlexTones.dark constructor

const FlexTones.dark({
  1. int primaryTone = 80,
  2. int onPrimaryTone = 20,
  3. int primaryContainerTone = 30,
  4. int onPrimaryContainerTone = 90,
  5. int secondaryTone = 80,
  6. int onSecondaryTone = 20,
  7. int secondaryContainerTone = 30,
  8. int onSecondaryContainerTone = 90,
  9. int tertiaryTone = 80,
  10. int onTertiaryTone = 20,
  11. int tertiaryContainerTone = 30,
  12. int onTertiaryContainerTone = 90,
  13. int errorTone = 80,
  14. int onErrorTone = 20,
  15. int errorContainerTone = 30,
  16. int onErrorContainerTone = 80,
  17. int backgroundTone = 10,
  18. int onBackgroundTone = 90,
  19. int surfaceTone = 10,
  20. int onSurfaceTone = 90,
  21. int surfaceVariantTone = 30,
  22. int onSurfaceVariantTone = 80,
  23. int outlineTone = 60,
  24. int outlineVariantTone = 30,
  25. int shadowTone = 0,
  26. int scrimTone = 0,
  27. int inverseSurfaceTone = 90,
  28. int onInverseSurfaceTone = 20,
  29. int inversePrimaryTone = 40,
  30. int surfaceTintTone = 80,
  31. double? primaryChroma,
  32. double? primaryMinChroma,
  33. double? secondaryChroma,
  34. double? secondaryMinChroma,
  35. double? tertiaryChroma,
  36. double? tertiaryMinChroma,
  37. double? tertiaryHueRotation,
  38. double? errorChroma,
  39. double? errorMinChroma,
  40. double? neutralChroma = 4,
  41. double? neutralMinChroma,
  42. double? neutralVariantChroma = 8,
  43. double? neutralVariantMinChroma,
  44. FlexPaletteType paletteType = FlexPaletteType.common,
})

Create a M3 standard dark 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.dark 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 4 and 8 as in Material 3 design. You can create a FlexTones.dark 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.

Implementation

const FlexTones.dark({
  this.primaryTone = 80,
  this.onPrimaryTone = 20,
  this.primaryContainerTone = 30,
  this.onPrimaryContainerTone = 90,
  this.secondaryTone = 80,
  this.onSecondaryTone = 20,
  this.secondaryContainerTone = 30,
  this.onSecondaryContainerTone = 90,
  this.tertiaryTone = 80,
  this.onTertiaryTone = 20,
  this.tertiaryContainerTone = 30,
  this.onTertiaryContainerTone = 90,
  this.errorTone = 80,
  this.onErrorTone = 20,
  this.errorContainerTone = 30,
  this.onErrorContainerTone = 80,
  //
  this.backgroundTone = 10,
  this.onBackgroundTone = 90,
  this.surfaceTone = 10,
  this.onSurfaceTone = 90,
  this.surfaceVariantTone = 30,
  this.onSurfaceVariantTone = 80,
  this.outlineTone = 60,
  this.outlineVariantTone = 30,
  this.shadowTone = 0,
  this.scrimTone = 0,
  this.inverseSurfaceTone = 90,
  this.onInverseSurfaceTone = 20,
  this.inversePrimaryTone = 40,
  this.surfaceTintTone = 80,
  //
  this.primaryChroma,
  this.primaryMinChroma,
  this.secondaryChroma,
  this.secondaryMinChroma,
  this.tertiaryChroma,
  this.tertiaryMinChroma,
  this.tertiaryHueRotation,
  this.errorChroma,
  this.errorMinChroma,
  this.neutralChroma = 4,
  this.neutralMinChroma,
  this.neutralVariantChroma = 8,
  this.neutralVariantMinChroma,
  this.paletteType = FlexPaletteType.common,
});