The converter will automatically detect and convert between RGB and HEX formats.
If you like this project, please consider sponsoring.
The plugin supports various formats for usage.
var rgbHex = require('rgbhex');
console.log(rgbHex('rgb(0, 0, 0)')); // #000000
<script src="/rgbHex/dist/jquery-rgbHex.min.js"></script>
<script>
console.log($.rgbHex('rgb(0, 0, 0)')); // #000000
</script>
<script src="/rgbHex/dist/rgbHex.min.js"></script>
<script>
console.log(window.rgbHex('rgb(0, 0, 0)')); // #000000
</script>