ColorPalette class final
A palette extracted from a source image: a ranked list of dominant colors plus the six classic Android-Palette swatches (vibrant, muted, and their light/dark variants).
Obtain an instance with PaletteExtractor.fromRgbaBytes,
ColorPalette.fromPixels or ColorPalette.fromColors.
Properties
-
colors
→ List<
Color> -
All extracted colors, ranked from most to least represented.
no setter
- darkMutedColor → Color?
-
A desaturated, dark color, or
null.no setter - darkVibrantColor → Color?
-
A vibrant color with low lightness, or
null.no setter - dominantColor → Color
-
The single most represented color in the source image.
no setter
- dominantSwatch → PaletteSwatch?
-
The dominant color as a PaletteSwatch, including its population.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lightMutedColor → Color?
-
A desaturated, light color, or
null.no setter - lightVibrantColor → Color?
-
A bright vibrant color (light tone), or
null.no setter - mutedColor → Color?
-
A desaturated color, or
null.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
swatches
→ List<
PaletteSwatch> -
All candidate swatches found in the source, sorted by descending
population.
final
-
targetSwatches
→ Map<
String, PaletteSwatch> -
The six classic swatch targets and their best match, if any.
final
- vibrantColor → Color?
-
The most vibrant color, or
nullwhen the source has no saturated colors.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
populationOf(
Color color) → int? -
Population (pixel count) for a specific color, or
nullif the color is not part of the palette. -
swatchFor(
String name) → PaletteSwatch? -
The best match for a named target (e.g.
'vibrant'), ornull. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromColors(
Iterable< Color> colors, {PaletteWeights weights = const PaletteWeights()}) → ColorPalette - Builds a palette from an explicit list of colors.
-
fromPopulations(
Map< int, int> candidates, {int maxColors = 16, PaletteWeights weights = const PaletteWeights()}) → ColorPalette - Builds a palette from quantized colors and their populations.