import chroma from '../../chroma.mjs';
import Color from '../../Color.mjs';
import input from '../input.mjs';
import type from '../../utils/type.mjs';
import unpack from '../../utils/unpack.mjs';
import cmyk2rgb from './cmyk2rgb.mjs';
import rgb2cmyk from './rgb2cmyk.mjs';

Color.prototype.cmyk = function () {
    return rgb2cmyk(this._rgb);
};

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

input.format.cmyk = cmyk2rgb;

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

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