var d = function(a, o, e, r) {
  var f = r.clientWidth, g = r.clientHeight, u = typeof a.pageX == "number" ? a.pageX : a.touches[0].pageX, v = typeof a.pageY == "number" ? a.pageY : a.touches[0].pageY, n = u - (r.getBoundingClientRect().left + window.pageXOffset), l = v - (r.getBoundingClientRect().top + window.pageYOffset);
  if (o === "vertical") {
    var t = void 0;
    if (l < 0)
      t = 359;
    else if (l > g)
      t = 0;
    else {
      var c = -(l * 100 / g) + 100;
      t = 360 * c / 100;
    }
    if (e.h !== t)
      return {
        h: t,
        s: e.s,
        l: e.l,
        a: e.a,
        source: "hsl"
      };
  } else {
    var i = void 0;
    if (n < 0)
      i = 0;
    else if (n > f)
      i = 359;
    else {
      var p = n * 100 / f;
      i = 360 * p / 100;
    }
    if (e.h !== i)
      return {
        h: i,
        s: e.s,
        l: e.l,
        a: e.a,
        source: "hsl"
      };
  }
  return null;
};
export {
  d as calculateChange
};
//# sourceMappingURL=hue.js.map
