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 hsi2rgb from './hsi2rgb.mjs';
import rgb2hsi from './rgb2hsi.mjs';

Color.prototype.hsi = function () {
    return rgb2hsi(this._rgb);
};

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

input.format.hsi = hsi2rgb;

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

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