code: function getHueDifference(value) {
      return hues.reduce(function (min, hue) {
        var diff = Math.abs(hue - value);
        if (diff < min) {
          return diff;
        }
        return min;
      }, Infinity);
    }
docs: Returns the hue with the smallest difference.