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) {
  .neutral => .fromHueAndChroma(
    sourceColorHct.hue,
    platform == .phone ? 1.4 : 6.0,
  ),
  .tonalSpot => .fromHueAndChroma(
    sourceColorHct.hue,
    platform == .phone ? 5.0 : 10.0,
  ),
  .expressive => .fromHueAndChroma(
    _getExpressiveNeutralHue(sourceColorHct),
    _getExpressiveNeutralChroma(sourceColorHct, isDark, platform),
  ),
  .vibrant => .fromHueAndChroma(
    _getVibrantNeutralHue(sourceColorHct),
    _getVibrantNeutralChroma(sourceColorHct, platform),
  ),
  _ => super.getNeutralPalette(
    variant,
    sourceColorHct,
    isDark,
    platform,
    contrastLevel,
  ),
};