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

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

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

input.format.hsl = hsl2rgb;

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

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