function componentToHex(c) {
    const hex = c.toString(16);
    return hex.length === 1 ? "0" + hex : hex;
}
function rgbToHex(r, g, b) {
    return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
}
function hexToRgb(hex) {
    const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
    return result
        ? {
            r: parseInt(result[1], 16),
            g: parseInt(result[2], 16),
            b: parseInt(result[3], 16),
        }
        : null;
}
export function getShades(color) {
    const shades = {
        50: "",
        100: "",
        200: "",
        300: "",
        400: "",
        500: "",
        600: "",
        700: "",
        800: "",
        900: "",
    };
    for (const [key] of Object.entries(shades)) {
        const ratio = (900 - parseInt(key)) / 100;
        const r = Math.round(hexToRgb(color).r + (255 - hexToRgb(color).r) * 0.1 * ratio);
        const g = Math.round(hexToRgb(color).g + (255 - hexToRgb(color).g) * 0.1 * ratio);
        const b = Math.round(hexToRgb(color).b + (255 - hexToRgb(color).b) * 0.1 * ratio);
        shades[key] = rgbToHex(r, g, b);
    }
    return shades;
}
//# sourceMappingURL=shadeCalculator.js.map