import chroma from '../../chroma.mjs';
import Color from '../../Color.mjs';
import input from '../input.mjs';
import type from '../../utils/type.mjs';
import num2rgb from './num2rgb.mjs';
import rgb2num from './rgb2num.mjs';

Color.prototype.num = function () {
    return rgb2num(this._rgb);
};

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

Object.assign(chroma, { num: num$1 });

input.format.num = num2rgb;

input.autodetect.push({
    p: 5,
    test: (...args) => {
        if (
            args.length === 1 &&
            type(args[0]) === 'number' &&
            args[0] >= 0 &&
            args[0] <= 0xffffff
        ) {
            return 'num';
        }
    }
});

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