(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.rgbToHex = void 0;
    var rgbToHex = function (_a) {
        var r = _a.r, g = _a.g, b = _a.b;
        var hex = [
            componentToHex(Math.round(r).toString(16)),
            componentToHex(Math.round(g).toString(16)),
            componentToHex(Math.round(b).toString(16))
        ];
        return "#" + hex.join("");
    };
    exports.rgbToHex = rgbToHex;
    var componentToHex = function (c) {
        return c.length === 1 ? "0" + c : "" + c;
    };
});
