getNeutralPalette method
TonalPalette
getNeutralPalette(
- TonalPaletteSourceColor sourceColor,
- Variant variant,
- bool isDark,
- double contrastLevel,
- Platform platform,
- SpecVersion specVersion,
override
Implementation
@override
TonalPalette getNeutralPalette(
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,
),
.fruitSalad => .fromHueAndChroma(sourceColor.asHct.hue, 10.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, 6.0),
.expressive => .fromHueAndChroma(
MathUtils.sanitizeDegreesDouble(sourceColor.asHct.hue + 15.0),
8.0,
),
.vibrant => .fromHueAndChroma(sourceColor.asHct.hue, 10.0),
_ => throw ArgumentError.value(
variant,
"variant",
"Variant is not supported in current spec.",
),
};