DynamicColor constructor
- required String name,
- required TonalPalette palette(),
- required double tone(),
- required bool isBackground,
- required DynamicColor background()?,
- required DynamicColor secondBackground()?,
- required ContrastCurve? contrastCurve,
- required ToneDeltaPair toneDeltaPair()?,
The base (explicit) constructor for DynamicColor.
name The name of the dynamic color.
palette Function that provides a TonalPalette given
DynamicScheme. A TonalPalette is defined by a hue and chroma, so this
replaces the need to specify hue/chroma. By providing a tonal palette,
when contrast adjustments are made, intended chroma can be preserved.
tone Function that provides a tone, given a DynamicScheme.
isBackground Whether this dynamic color is a background, with
some other color as the foreground.
background The background of the dynamic color (as a function of a
DynamicScheme
), if it exists.
secondBackground A second background of the dynamic color (as a function
of a DynamicScheme
), if it
exists.
contrastCurve A ContrastCurve object specifying how its contrast
against its background should behave in various contrast levels options.
toneDeltaPair A ToneDeltaPair object specifying a tone delta
constraint between two colors. One of them must be the color being
constructed.
Implementation
DynamicColor({
required this.name,
required this.palette,
required this.tone,
required this.isBackground,
required this.background,
required this.secondBackground,
required this.contrastCurve,
required this.toneDeltaPair,
});