SchemeFidelity constructor
SchemeFidelity({ - required Hct sourceColorHct,
- required bool isDark,
- required double contrastLevel,
})
Implementation
SchemeFidelity({
required Hct sourceColorHct,
required super.isDark,
required super.contrastLevel,
}) : super(
sourceColorArgb: sourceColorHct.toInt(),
variant: Variant.fidelity,
primaryPalette: TonalPalette.of(
sourceColorHct.hue,
sourceColorHct.chroma,
),
secondaryPalette: TonalPalette.of(
sourceColorHct.hue,
math.max(sourceColorHct.chroma - 32.0, sourceColorHct.chroma * 0.5),
),
tertiaryPalette: TonalPalette.fromHct(
DislikeAnalyzer.fixIfDisliked(
TemperatureCache(sourceColorHct).complement,
),
),
neutralPalette: TonalPalette.of(
sourceColorHct.hue,
sourceColorHct.chroma / 8.0,
),
neutralVariantPalette: TonalPalette.of(
sourceColorHct.hue,
(sourceColorHct.chroma / 8.0) + 4.0,
),
);