import type from '../../utils/type.mjs';
import unpack from '../../utils/unpack.mjs';
import chroma from '../../chroma.mjs';
import Color from '../../Color.mjs';
import input from '../input.mjs';
import lab2rgb from './lab2rgb.mjs';
import rgb2lab from './rgb2lab.mjs';
import { setLabWhitePoint, getLabWhitePoint } from './lab-constants.mjs';

Color.prototype.lab = function () {
    return rgb2lab(this._rgb);
};

const lab$1 = (...args) => new Color(...args, 'lab');
Object.assign(chroma, { lab: lab$1, getLabWhitePoint, setLabWhitePoint });

input.format.lab = lab2rgb;

input.autodetect.push({
    p: 2,
    test: (...args) => {
        args = unpack(args, 'lab');
        if (type(args) === 'array' && args.length === 3) {
            return 'lab';
        }
    }
});

export { getLabWhitePoint, lab$1 as lab, setLabWhitePoint };
//# sourceMappingURL=index.mjs.map
