FlexTones.light constructor

const FlexTones.light({
  1. int primaryTone = 40,
  2. int onPrimaryTone = 100,
  3. int primaryContainerTone = 90,
  4. int onPrimaryContainerTone = 10,
  5. int primaryFixedTone = 90,
  6. int primaryFixedDimTone = 80,
  7. int onPrimaryFixedTone = 10,
  8. int onPrimaryFixedVariantTone = 30,
  9. int secondaryTone = 40,
  10. int onSecondaryTone = 100,
  11. int secondaryContainerTone = 90,
  12. int onSecondaryContainerTone = 10,
  13. int secondaryFixedTone = 90,
  14. int secondaryFixedDimTone = 80,
  15. int onSecondaryFixedTone = 10,
  16. int onSecondaryFixedVariantTone = 30,
  17. int tertiaryTone = 40,
  18. int onTertiaryTone = 100,
  19. int tertiaryContainerTone = 90,
  20. int onTertiaryContainerTone = 10,
  21. int tertiaryFixedTone = 90,
  22. int tertiaryFixedDimTone = 80,
  23. int onTertiaryFixedTone = 10,
  24. int onTertiaryFixedVariantTone = 30,
  25. int errorTone = 40,
  26. int onErrorTone = 100,
  27. int errorContainerTone = 90,
  28. int onErrorContainerTone = 10,
  29. int surfaceTone = 98,
  30. int surfaceDimTone = 87,
  31. int surfaceBrightTone = 98,
  32. int surfaceContainerLowestTone = 100,
  33. int surfaceContainerLowTone = 96,
  34. int surfaceContainerTone = 94,
  35. int surfaceContainerHighTone = 92,
  36. int surfaceContainerHighestTone = 90,
  37. int onSurfaceTone = 10,
  38. int onSurfaceVariantTone = 30,
  39. int inverseSurfaceTone = 20,
  40. int onInverseSurfaceTone = 95,
  41. int inversePrimaryTone = 80,
  42. int surfaceTintTone = 40,
  43. int outlineTone = 50,
  44. int outlineVariantTone = 80,
  45. int shadowTone = 0,
  46. int scrimTone = 0,
  47. @Deprecated('Use surfaceTone instead.') int? backgroundTone,
  48. @Deprecated('Use onSurfaceTone instead.') int? onBackgroundTone,
  49. @Deprecated('Use surfaceContainerHighestTone instead.') int? surfaceVariantTone,
  50. double? primaryChroma,
  51. double? primaryMinChroma,
  52. double? secondaryChroma,
  53. double? secondaryMinChroma,
  54. double? tertiaryChroma,
  55. double? tertiaryMinChroma,
  56. double? tertiaryHueRotation,
  57. double? errorChroma,
  58. double? errorMinChroma,
  59. double? neutralChroma = 6,
  60. double? neutralMinChroma,
  61. double? neutralVariantChroma = 8,
  62. double? neutralVariantMinChroma,
  63. FlexPaletteType paletteType = FlexPaletteType.extended,
  64. 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,
});