fromIndex static method

PaletteColors fromIndex(
  1. int index
)

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'),
  );
}