JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test">
</div>
CSS
#test{
border-right-color: #000;
}
JavaScript
if(rgb2hex($("#test").css("border-right-color")) == "#000000"){
console.log("yup");
}
function rgb2hex(rgb){
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return "#" +
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[3],10).toString(16)).slice(-2);
}