paperGrainOf function

int paperGrainOf(
  1. BackgroundSpec bg
)

The grain strength g (‰, 0–1000) of a paper sheet bg.

Implementation

int paperGrainOf(BackgroundSpec bg) {
  final g = bg.angleTenths;
  return g < 0 ? 0 : (g > 1000 ? 1000 : g);
}