js获取随机颜色

73 阅读1分钟

1.js获取随机颜色

function getRandomColor(){

return #${Math.floor(Math.random() * 0xffffff) .toString(16)};

}

console.log(getRandomColor())