随机生成16位颜色

createRandomColor() {
  let color = Math.floor((Math.random() * 256 * 256 * 256)).toString(16)
  while (color.length < 6) {//随机生成的可能只有3-6位字符串
  color += Math.floor((Math.random() * 16)).toString(16)
  }
  return color
}
原文地址:https://www.cnblogs.com/brainworld/p/7919582.html