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