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 hcg2rgb from './hcg2rgb.mjs';
import rgb2hcg from './rgb2hcg.mjs';

Color.prototype.hcg = function () {
    return rgb2hcg(this._rgb);
};

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

input.format.hcg = hcg2rgb;

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

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