export var calculateChange = function (e, hsl, container) {
    var _a = container.getBoundingClientRect(), containerWidth = _a.width, containerHeight = _a.height;
    var x = 0;
    var y = 0;
    if ("pageX" in e) {
        x = e.pageX;
    }
    if ("pageY" in e) {
        y = e.pageY;
    }
    var left = x - (container.getBoundingClientRect().left + window.scrollX);
    var top = y - (container.getBoundingClientRect().top + window.scrollY);
    if (left < 0) {
        left = 0;
    }
    else if (left > containerWidth) {
        left = containerWidth;
    }
    if (top < 0) {
        top = 0;
    }
    else if (top > containerHeight) {
        top = containerHeight;
    }
    var saturation = left / containerWidth;
    var bright = 1 - top / containerHeight;
    return {
        h: hsl.h,
        s: saturation,
        v: bright
    };
};
