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 hsv2rgb from './hsv2rgb.mjs';
import rgb2hsl from './rgb2hsv.mjs';

Color.prototype.hsv = function () {
    return rgb2hsl(this._rgb);
};

const hsv$1 = (...args) => new Color(...args, 'hsv');
chroma.hsv = hsv$1;

input.format.hsv = hsv2rgb;

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

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