call method

R call(
  1. double value
)

Maps a domain value to a range value.

Implementation

R call(double value) {
  if (_thresholds.isEmpty) {
    return _range.first;
  }

  int i = 0;
  while (i < _thresholds.length && value > _thresholds[i]) {
    i++;
  }

  return _range[i];
}