getNeutralVariantPalette method
TonalPalette
getNeutralVariantPalette(
- TonalPaletteSourceColor sourceColor,
- Variant variant,
- bool isDark,
- double contrastLevel,
- Platform platform,
- SpecVersion specVersion,
override
Implementation
@override
TonalPalette getNeutralVariantPalette(
TonalPaletteSourceColor sourceColor,
Variant variant,
bool isDark,
double contrastLevel,
Platform platform,
SpecVersion specVersion,
) => switch (variant) {
.content || .fidelity => .fromHueAndChroma(
sourceColor.asHct.hue,
(sourceColor.asHct.chroma / 8.0) + 4.0,
),
.fruitSalad => .fromHueAndChroma(sourceColor.asHct.hue, 16.0),
.monochrome => .fromHueAndChroma(sourceColor.asHct.hue, 0.0),
.neutral => .fromHueAndChroma(sourceColor.asHct.hue, 2.0),
.rainbow => .fromHueAndChroma(sourceColor.asHct.hue, 0.0),
.tonalSpot => .fromHueAndChroma(sourceColor.asHct.hue, 8.0),
.expressive => .fromHueAndChroma(
MathUtils.sanitizeDegreesDouble(sourceColor.asHct.hue + 15.0),
12.0,
),
.vibrant => .fromHueAndChroma(sourceColor.asHct.hue, 12.0),
_ => throw ArgumentError.value(
variant,
"variant",
"Variant is not supported in current spec.",
),
};