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 oklab2rgb from './oklab2rgb.mjs';
import rgb2oklab from './rgb2oklab.mjs';

Color.prototype.oklab = function () {
    return rgb2oklab(this._rgb);
};

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

input.format.oklab = oklab2rgb;

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

export { oklab$1 as oklab };
//# sourceMappingURL=index.mjs.map
