getPrimaryPalette method

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

Implementation

@override
TonalPalette getPrimaryPalette(
  Variant variant,
  Hct sourceColorHct,
  bool isDark,
  Platform platform,
  double contrastLevel,
) => switch (variant) {
  .content ||
  .fidelity => .fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma),
  .fruitSalad => .fromHueAndChroma(
    MathUtils.sanitizeDegreesDouble(sourceColorHct.hue - 50.0),
    48.0,
  ),
  .monochrome => .fromHueAndChroma(sourceColorHct.hue, 0.0),
  .neutral => .fromHueAndChroma(sourceColorHct.hue, 12.0),
  .rainbow => .fromHueAndChroma(sourceColorHct.hue, 48.0),
  .tonalSpot => .fromHueAndChroma(sourceColorHct.hue, 36.0),
  .expressive => .fromHueAndChroma(
    MathUtils.sanitizeDegreesDouble(sourceColorHct.hue + 240.0),
    40.0,
  ),
  .vibrant => .fromHueAndChroma(sourceColorHct.hue, 200.0),
};