fromIndex static method
Returns the PaletteColor corresponding to the given index.
Implementation
static PaletteColors fromIndex(int index) {
return PaletteColors.values.firstWhere(
(color) => color.paletteIndex == index,
orElse: () =>
throw ArgumentError('No PaletteColor found for index $index'),
);
}