lerp static method

Linearly interpolates between two spacing units.

Creates smooth transitions between different spacing strategies, useful for animations and responsive spacing.

Implementation

static SpacingUnit lerp(SpacingUnit a, SpacingUnit b, double t) {
  if (t <= 0.0) return a;
  if (t >= 1.0) return b;
  return a * _FixedSpacing(1.0 - t) + b * _FixedSpacing(t);
}