DynamicScheme class

Provides important settings for creating colors dynamically, and 6 color palettes.

Requires:

  1. A color. (source color)
  2. A theme. (Variant)
  3. Whether or not its dark mode.
  4. Contrast level. (-1 to 1, currently contrast ratio 3.0 and 7.0)
Implementers

Constructors

DynamicScheme({required Hct sourceColorHct, required Variant variant, required bool isDark, required double contrastLevel, Platform platform = defaultPlatform, SpecVersion specVersion = defaultSpecVersion, required TonalPalette primaryPalette, required TonalPalette secondaryPalette, required TonalPalette tertiaryPalette, required TonalPalette neutralPalette, required TonalPalette neutralVariantPalette, TonalPalette? errorPalette})
DynamicScheme.fromPalettesOrKeyColors({required bool isDark, Hct? sourceColorHct, double? contrastLevel, Variant? variant, Platform? platform, SpecVersion? specVersion, TonalPalette? primaryPalette, TonalPalette? secondaryPalette, TonalPalette? tertiaryPalette, TonalPalette? neutralPalette, TonalPalette? neutralVariantPalette, TonalPalette? errorPalette, Hct? primaryPaletteKeyColor, Hct? secondaryPaletteKeyColor, Hct? tertiaryPaletteKeyColor, Hct? neutralPaletteKeyColor, Hct? neutralVariantPaletteKeyColor, Hct? errorPaletteKeyColor})

Properties

background int
no setter
contrastLevel double
Value from -1 to 1. -1 represents minimum contrast. 0 represents standard (i.e. the design as spec'd), and 1 represents maximum contrast.
final
controlActivated int
no setter
controlHighlight int
no setter
controlNormal int
no setter
error int
no setter
errorContainer int
no setter
errorDim int
no setter
errorPalette TonalPalette
final
errorPaletteKeyColor int
no setter
hashCode int
The hash code for this object.
no setteroverride
inverseOnSurface int
no setter
inversePrimary int
no setter
inverseSurface int
no setter
isDark bool
Whether or not the scheme is dark mode.
final
neutralPalette TonalPalette
final
neutralPaletteKeyColor int
no setter
neutralVariantPalette TonalPalette
final
neutralVariantPaletteKeyColor int
no setter
onBackground int
no setter
onError int
no setter
onErrorContainer int
no setter
onPrimary int
no setter
onPrimaryContainer int
no setter
onPrimaryFixed int
no setter
onPrimaryFixedVariant int
no setter
onSecondary int
no setter
onSecondaryContainer int
no setter
onSecondaryFixed int
no setter
onSecondaryFixedVariant int
no setter
onSurface int
no setter
onSurfaceVariant int
no setter
onTertiary int
no setter
onTertiaryContainer int
no setter
onTertiaryFixed int
no setter
onTertiaryFixedVariant int
no setter
outline int
no setter
outlineVariant int
no setter
platform Platform
The platform on which this scheme is intended to be used.
final
primary int
no setter
primaryContainer int
no setter
primaryDim int
no setter
primaryFixed int
no setter
primaryFixedDim int
no setter
primaryPalette TonalPalette
final
primaryPaletteKeyColor int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrim int
no setter
secondary int
no setter
secondaryContainer int
no setter
secondaryDim int
no setter
secondaryFixed int
no setter
secondaryFixedDim int
no setter
secondaryPalette TonalPalette
final
secondaryPaletteKeyColor int
no setter
shadow int
no setter
sourceColorArgb int
The source color of the scheme in ARGB format.
final
sourceColorHct Hct
The source color of the scheme in HCT format.
final
specVersion SpecVersion
The spec version of the scheme.
final
surface int
no setter
surfaceBright int
no setter
surfaceContainer int
no setter
surfaceContainerHigh int
no setter
surfaceContainerHighest int
no setter
surfaceContainerLow int
no setter
surfaceContainerLowest int
no setter
surfaceDim int
no setter
surfaceTint int
no setter
surfaceVariant int
no setter
tertiary int
no setter
tertiaryContainer int
no setter
tertiaryDim int
no setter
tertiaryFixed int
no setter
tertiaryFixedDim int
no setter
tertiaryPalette TonalPalette
final
tertiaryPaletteKeyColor int
no setter
textHintInverse int
no setter
textPrimaryInverse int
no setter
textPrimaryInverseDisableOnly int
no setter
textSecondaryAndTertiaryInverse int
no setter
textSecondaryAndTertiaryInverseDisabled int
no setter
variant Variant
The variant of the scheme.
final

Methods

getArgb(DynamicColor dynamicColor) int
getHct(DynamicColor dynamicColor) Hct
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

from(DynamicScheme other, bool isDark, [double? contrastLevel]) DynamicScheme
getPiecewiseValue(Hct sourceColorHct, List<double> hueBreakpoints, List<double> hues) double
getRotatedHue(Hct sourceColorHct, List<double> hueBreakpoints, List<double> rotations) double

Constants

defaultPlatform → const Platform
defaultSpecVersion → const SpecVersion