"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.invertColor = exports.contrastColor = void 0;
const contrastColor = (hex) => {
    const r = parseInt(hex.substring(1, 3), 16);
    const g = parseInt(hex.substring(3, 5), 16);
    const b = parseInt(hex.substring(5, 7), 16);
    const brightness = ((r * 299) + (g * 587) + (b * 114)) / 1000;
    return brightness > 128 ? "#000000" : "#FFFFFF";
};
exports.contrastColor = contrastColor;
const invertColor = (hex) => {
    const r = 255 - parseInt(hex.substring(1, 3), 16);
    const g = 255 - parseInt(hex.substring(3, 5), 16);
    const b = 255 - parseInt(hex.substring(5, 7), 16);
    return "#" + [r, g, b].map(x => x.toString(16).padStart(2, "0")).join("");
};
exports.invertColor = invertColor;
//# sourceMappingURL=colors.js.map