getTertiaryPalette method
TonalPalette
getTertiaryPalette(
- TonalPaletteSourceColor sourceColor,
- Variant variant,
- bool isDark,
- double contrastLevel,
- Platform platform,
- SpecVersion specVersion,
override
Implementation
@override
TonalPalette getTertiaryPalette(
TonalPaletteSourceColor sourceColor,
Variant variant,
bool isDark,
double contrastLevel,
Platform platform,
SpecVersion specVersion,
) => switch (variant) {
.content => .fromHct(
DislikeAnalyzer.fixIfDisliked(
TemperatureCache(sourceColor.asHct).getAnalogousColors(3, 6)[2],
),
),
.fidelity => .fromHct(
DislikeAnalyzer.fixIfDisliked(
TemperatureCache(sourceColor.asHct).getComplement(),
),
),
.fruitSalad => .fromHueAndChroma(sourceColor.asHct.hue, 36.0),
.monochrome => .fromHueAndChroma(sourceColor.asHct.hue, 0.0),
.neutral => .fromHueAndChroma(sourceColor.asHct.hue, 16.0),
.rainbow || .tonalSpot => .fromHueAndChroma(
MathUtils.sanitizeDegreesDouble(sourceColor.asHct.hue + 60.0),
24.0,
),
.expressive => .fromHueAndChroma(
DynamicScheme.getRotatedHue(
sourceColor.asHct,
[0.0, 21.0, 51.0, 121.0, 151.0, 191.0, 271.0, 321.0, 360.0],
[120.0, 120.0, 20.0, 45.0, 20.0, 15.0, 20.0, 120.0, 120.0],
),
32.0,
),
.vibrant => .fromHueAndChroma(
DynamicScheme.getRotatedHue(
sourceColor.asHct,
[0.0, 41.0, 61.0, 101.0, 131.0, 181.0, 251.0, 301.0, 360.0],
[35.0, 30.0, 20.0, 25.0, 30.0, 35.0, 30.0, 25.0, 25.0],
),
32.0,
),
_ => throw ArgumentError.value(
variant,
"variant",
"Variant is not supported in current spec.",
),
};