haloActor function

void haloActor(
  1. Painter p,
  2. ActorDefinition? a,
  3. int c,
  4. double k, [
  5. double t = 0.0,
])

A glowing 1 px line just outside a character, flickering.

Implementation

void haloActor(
  Painter p,
  ActorDefinition? a,
  int c,
  double k, [
  double t = 0.0,
]) {
  if (a == null || k <= 0.02) return;
  p.outlineShaded(
    a.mask,
    a.x,
    a.y,
    color: (_, _) => c,
    alpha: (mx, my) => k * (0.75 + 0.45 * noise(my * 0.45 - t * 7.0, mx * 3)),
  );
}