ringFast function

void ringFast(
  1. Painter p,
  2. num x,
  3. num y,
  4. num r,
  5. num w,
  6. int c, [
  7. double a = 1.0,
])

A ring from radius r - w out to r round (x, y), visiting only the band's own pixels so a big thin shock ring stays cheap.

Implementation

void ringFast(
  Painter p,
  num x,
  num y,
  num r,
  num w,
  int c, [
  double a = 1.0,
]) {
  final rd = r.toDouble();
  if (rd <= 0) return;
  final r0 = math.max(0.0, rd - w.toDouble());
  final xd = x.toDouble();
  final yd = y.toDouble();
  _annulus(xd, yd, r0, rd, (cx, cy, d) {
    p.dot(cx, cy, c, a);
  });
}