DivergingScale<R> constructor

DivergingScale<R>({
  1. List<double>? domain,
  2. required Interpolator<R> interpolator,
  3. bool clamp = false,
})

Creates a diverging scale with the given parameters. Domain should have 3 values: min, mid, max

Implementation

DivergingScale({
  List<double>? domain,
  required Interpolator<R> interpolator,
  bool clamp = false,
})  : _domain = domain ?? [0, 0.5, 1],
      _interpolator = interpolator,
      _clamp = clamp {
  assert(_domain.length == 3,
      'Diverging scale requires exactly 3 domain values');
}