JSFiddle - React, Tailwind, and code Playground

by Alexandru Gatea

HTML

<div></div>

<script type="text/javascript" src="https://chir.ag/projects/ntc/ntc.js"></script>

<script type="text/javascript">

  var n_match = ntc.name("#bada55");
  n_rgb = n_match[0]; // RGB value of closest match
  n_name = n_match[1]; // Text string: Color name
  n_exactmatch = n_match[2]; // True if exact color match

  document.body.style.backgroundColor = n_match[0];
	document.body.innerHTML = "HEX:" +  n_match[0] + ", Closest name:" + n_match[1] + ", Exact match: " + n_match[2] ;

</script>