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 oklch2rgb from './oklch2rgb.mjs';
import rgb2oklch from './rgb2oklch.mjs';

Color.prototype.oklch = function () {
    return rgb2oklch(this._rgb);
};

const oklch = (...args) => new Color(...args, 'oklch');
Object.assign(chroma, { oklch });

input.format.oklch = oklch2rgb;

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

export { oklch };
//# sourceMappingURL=index.mjs.map
