getNeutralPalette method

  1. @override
TonalPalette getNeutralPalette(
  1. Variant variant,
  2. Hct sourceColorHct,
  3. bool isDark,
  4. Platform platform,
  5. double contrastLevel,
)
override

Implementation

@override
TonalPalette getNeutralPalette(
  Variant variant,
  Hct sourceColorHct,
  bool isDark,
  Platform platform,
  double contrastLevel,
) => switch (variant) {
  .content || .fidelity => .fromHueAndChroma(
    sourceColorHct.hue,
    sourceColorHct.chroma / 8.0,
  ),
  .fruitSalad => .fromHueAndChroma(sourceColorHct.hue, 10.0),
  .monochrome => .fromHueAndChroma(sourceColorHct.hue, 0.0),
  .neutral => .fromHueAndChroma(sourceColorHct.hue, 2.0),
  .rainbow => .fromHueAndChroma(sourceColorHct.hue, 0.0),
  .tonalSpot => .fromHueAndChroma(sourceColorHct.hue, 6.0),
  .expressive => .fromHueAndChroma(
    MathUtils.sanitizeDegreesDouble(sourceColorHct.hue + 15.0),
    8.0,
  ),
  .vibrant => .fromHueAndChroma(sourceColorHct.hue, 10.0),
};