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
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2022-01-09
  • 2021-09-26
  • 2021-12-04
  • 2022-02-20
  • 2022-12-23
相关资源
相似解决方案