export 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("");
};
var componentToHex = function (c) {
    return c.length === 1 ? "0" + c : "" + c;
};
