init method

void init()

Initializes the particle effect by resetting all the particles and assigning a random color from the palette.

Implementation

void init() {
  if (palette == null) return;
  for (int i = 0; i < numParticles; i++) {
    var color = Rnd.getItem(palette!.colors!);
    particles[i] = Particle(color: color, shape: shape.drawType);
    resetParticle(i);
  }
}