ringLight function
void
ringLight(])
Light hugging a circle of radius R at (x, y), falling off over w
either side, only where keep returns true.
Implementation
void ringLight(
Painter p,
num x,
num y,
num R,
num w,
int col,
num k, [
bool Function(double x, double y)? keep,
]) {
final wd = w.toDouble();
final kd = k.toDouble();
if (wd < 1 || kd <= 0.004) return;
final rd = R.toDouble();
_annulus(x.toDouble(), y.toDouble(), math.max(0.0, rd - wd), rd + wd, (cx, cy, d) {
if (keep != null && !keep(cx, cy)) return;
final f = 1 - (d - rd).abs() / wd;
p.light(cx, cy, col, f * f * kd);
});
}