'use strict';

var index = require('../utils/index.js');
var reusable = require('../channels/reusable.js');
var index$1 = require('../color/index.js');
var change = require('./change.js');

/* IMPORT */
/* MAIN */
const rgba = (r, g, b = 0, a = 1) => {
    if (typeof r !== 'number')
        return change(r, { a: g });
    const channels = reusable.set({
        r: index.channel.clamp.r(r),
        g: index.channel.clamp.g(g),
        b: index.channel.clamp.b(b),
        a: index.channel.clamp.a(a)
    });
    return index$1.stringify(channels);
};

module.exports = rgba;
