Answers for "convert string to hexadecimal in javascript"

4

javascript string to hex

var rgbToHex = function (rgb) { 
  var hex = Number(rgb).toString(16);
  if (hex.length < 2) {
       hex = "0" + hex;
  }
  return hex;
};
Posted by: Guest on June-18-2020

Code answers related to "convert string to hexadecimal in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language