(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 });
    var convertStringToHexFormat = function (string) {
        var matchHashSymbol = new RegExp("[\\s#,]+", "g");
        var matchNotHexSymbols = /[^\dA-Fa-f]/g;
        var hex = string
            .replace(matchHashSymbol, "")
            .replace(matchNotHexSymbols, "")
            .slice(0, 6)
            .toUpperCase();
        return hex.length > 0 ? "#" + hex : "";
    };
    exports.default = convertStringToHexFormat;
});
