interpolateColorToHex = ({
  value,
  clamp = true,
  defaultColor = DEFAULT_COLOR,
  interpolator = interpolatePuBu,
}) => {
  const newValue = clamp ? clampValue(0, 1)(value) : value;

  if (!Number.isFinite(newValue)) {
    // [r, g, b] => `rgb(r, g, b)`
    return `rgb(${defaultColor.join(', ')})`;
  }

  return interpolator(newValue);
}
map an input value to a given color scale, and return a color hex string

@param {Number} value: input value
@param {Boolean} clamp: whether to clamp the input value to [0, 1], default yes
@param {[Number]} defaultColor: fallback color
@return interpolated color in hex string format #1234FF