getRandomColor获取随机颜色 :

const getRandomColor = () => {
  let letters = "0123456789ABCDEF"
  let color = "#"
  for(let i = 0; i < 6; i++){
    color += letters[Math.floor(Math.random()*16)]
  }
  return color
}
console.log(getRandomColor())

MandyShen
166 声望21 粉丝