setPalette method

void setPalette(
  1. Palette palette
)

Sets the palette used for coloring.

Implementation

void setPalette(Palette palette) {
  this.palette = palette;
  particles
      .where((p) => p != null)
      .forEach((p) => p!.color = Rnd.getItem(palette.colors!));
}