SwatchMode enum
Describes the methods that may be employed to derive a range of Colors.
Constructors
- SwatchMode()
-
const
Values
- 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)
- 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 colorsalphaBlend
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.
- 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 whereshade500
would be the original color and progress around the color wheel pastshade900
and looping back toshade400
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 whereshade500
would be the original color and progress around the color wheel pastshade900
and looping back toshade400
and every shade would have the same "saturation" and "lightness" as the original color. - 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
ormaterialColor[500]
value is equivalent to the value returned bymaterialColor
used by itself as aColor
, ormaterialColor == materialColor[500]
.With this example, a generated
spectrumMaterialColor
using fade returns the equivalentColor
as that of the one represented byspectrumMaterialColor
used as itself when accessing itsshade900
, orspectrumMaterialColor == spectrumMaterialColor[900]
.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
SwatchMode> - A constant List of the values in this enum, in order of their declaration.