effectivePress function

double effectivePress(
  1. double p, {
  2. required bool reduceMotion,
})

The press depth a painter should draw: p itself (springs may overshoot outside 0, 1), or under Reduce Motion the discrete pressed artwork (motion brief §2.2.5) — 1 for any press, 0 at rest.

Implementation

double effectivePress(double p, {required bool reduceMotion}) {
  if (!reduceMotion) return p;
  return p > 0.01 ? 1 : 0;
}