SwatchMode enum Null safety

Describes the methods that may be employed to derive a range of Colors.

Constants

complements → const SwatchMode

For the generation of a color swatch that is comprised of equidistant complimentary colors.

For a MaterialColor, a 10-count complements List<Color> would mostly resemble a rainbow through the hues, but where shade500 would be the original color and progress around the color wheel past shade900 and looping back to shade400 and every shade would have the same "saturation" and "lightness" as the original color.

For a MaterialAccentColor, a 5-count complements List<Color> looks less like a rainbow and more like a resemble a rainbow through the hues, but where shade500 would be the original color and progress around the color wheel past shade900 and looping back to shade400 and every shade would have the same "saturation" and "lightness" as the original color.

const SwatchMode(2)
desaturate → const SwatchMode

Suggests the usage of Color.alphaBlend, such as creating a swatch where the lower colors alphaBlend the original color with Colors.white with increasing degrees of color alpha strength, and the upper colors alphaBlend the original with Colors.black with decreasing degrees of color alpha strength.

The lower values would progress toward white, regardless of original color, while the upper values progress toward black, regardless of original color. The medium value would resemble the original color.

const SwatchMode(1)
fade → const SwatchMode

Employ transparency in swatch development, such as fading from fully transparent and stepping up to fully opaque.

In the above example, the original color would not be a generated swatch's medium, or default, value. The original color would exist at the very top of the range produced for the swatch.

This differs from a standard MaterialColor, for example, as the shade500 or materialColor[500] value is equivalent to the value returned by materialColor used by itself as a Color, or materialColor == materialColor[500].

With this example, a generated spectrumMaterialColor using fade returns the equivalent Color as that of the one represented by spectrumMaterialColor used as itself when accessing its shade900, or spectrumMaterialColor == spectrumMaterialColor[900].

const SwatchMode(3)
shade → const SwatchMode

Implies the useage of Shading. See the withWhite() extension method for an example.

A swatch range of colors could be derived such as:

c.withWhite(-r),
...,
c.withWhite(-r/3),
c.withWhite(-r/4),
c,
c.withWhite(r/4),
c.withWhite(r/3),
...,
c.withWhite(r)
const SwatchMode(0)
values → const List<SwatchMode>

A constant List of the values in this enum, in order of their declaration.

const List<SwatchMode>

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited