fromColors static method
- Iterable<
Color> colors, { - PaletteWeights weights = const PaletteWeights(),
Builds a palette from an explicit list of colors.
Handy when colors were extracted elsewhere; every color receives a population of 1.
Implementation
static ColorPalette fromColors(
Iterable<Color> colors, {
PaletteWeights weights = const PaletteWeights(),
}) {
final candidates = <int, int>{for (final c in colors) c.toARGB32(): 1};
return fromPopulations(candidates, weights: weights);
}