📜  十六进制 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:49.752000             🧑  作者: Mango

代码示例4
var rgbToHex = function (rgb) { 
  var hex = Number(rgb).toString(16);
  if (hex.length < 2) {
       hex = "0" + hex;
  }
  return hex;
};