'use strict';

var index = require('../numbers/index.js');
var units = require('../numbers/units.js');
var sanitize = require('../utils/sanitize.js');
var utils = require('./utils.js');

const hsla = {
    test: /*@__PURE__*/ utils.isColorString("hsl", "hue"),
    parse: /*@__PURE__*/ utils.splitColor("hue", "saturation", "lightness"),
    transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {
        return ("hsla(" +
            Math.round(hue) +
            ", " +
            units.percent.transform(sanitize.sanitize(saturation)) +
            ", " +
            units.percent.transform(sanitize.sanitize(lightness)) +
            ", " +
            sanitize.sanitize(index.alpha.transform(alpha$1)) +
            ")");
    },
};

exports.hsla = hsla;
