SchemeContent constructor
SchemeContent({ - required Hct sourceColorHct,
- required bool isDark,
- required double contrastLevel,
})
Implementation
SchemeContent({
required Hct sourceColorHct,
required super.isDark,
required super.contrastLevel,
}) : super(
sourceColorArgb: sourceColorHct.toInt(),
variant: Variant.content,
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)
.analogous(count: 3, divisions: 6)
.last,
),
),
neutralPalette: TonalPalette.of(
sourceColorHct.hue,
sourceColorHct.chroma / 8.0,
),
neutralVariantPalette: TonalPalette.of(
sourceColorHct.hue,
(sourceColorHct.chroma / 8.0) + 4.0,
),
);