/**
 * @since Last modified: 2024/04/16 15:38:27
 * @function getColors
 * @description Let the hidden element be displayed.
 * @param {object} options  - The parameters of getColors.
 * @param {getEl} [options.el]  - The target node.The writing is the same as getEl.
 * @param {string} [options.display=none]  - The getColors method of box.Can be filled in:'none'|'hidden'.
 * @param {function} [options.done]  - The call back after completion.No parameters.
 * @returns {*} - The the target dom.
 * @see {@link https://codepen.io/axui/pen/BaMbGXR|demo @ codepen}
 * @example
 * ax.getColors({el:'#demo'});
 * <!--return the target dom-->
 */





'use strict';

let getColors = () => {
    let style = getComputedStyle(document.documentElement),
        getValue = (type:string) => {
            return [
                style.getPropertyValue(`--_h-${type}`),
                style.getPropertyValue(`--_s-${type}`),
                style.getPropertyValue(`--_l-${type}`),
                style.getPropertyValue(`--_a-${type}`)
            ].map(k => {
                let val = k.trim();
                return val.includes('%') ? val : Number(val);
            });
        };
    return {
        prim: getValue('prim'),
        text: getValue('text'),
        succ: getValue('succ'),
        error: getValue('error'),
        info: getValue('info'),
        warn: getValue('warn'),
        issue: getValue('issue'),
    }
};
export default getColors;
