import { hexToRGB } from './Utils.Common';
function rgbToHex(r, g, b) {
    return `#${(1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1)
        .toUpperCase()}`;
}
function adjust(color, amount) {
    return Math.min(255, Math.max(0, color + amount));
}
export var Utils;
(function (Utils) {
    function darken(hex, factor) {
        const [r, g, b] = hexToRGB(hex);
        return rgbToHex(adjust(r, -factor), adjust(g, -factor), adjust(b, -factor));
    }
    Utils.darken = darken;
    function lighten(hex, factor) {
        const [r, g, b] = hexToRGB(hex);
        return rgbToHex(adjust(r, factor), adjust(g, factor), adjust(b, factor));
    }
    Utils.lighten = lighten;
})(Utils || (Utils = {}));
//# sourceMappingURL=Utils.js.map