PaletteGenerator.fromColors constructor
Create a PaletteGenerator from a set of paletteColors and targets.
The usual way to create a PaletteGenerator is to use the asynchronous PaletteGenerator.fromImage static function. This constructor is mainly used for cases when you have your own source of color information and would like to use the target selection and scoring methods here.
The paletteColors
argument must not be null.
Implementation
PaletteGenerator.fromColors(this.paletteColors, {this.targets})
: assert(paletteColors != null),
selectedSwatches = <PaletteTarget, PaletteColor>{} {
_sortSwatches();
_selectSwatches();
}