function createColor() { let str = '0123456789abcdef' let colors = '#' for (let i = 0; i < 6; i++) { colors += str[Math.floor(Math.random() * 16)] } return colors }
随机生成十六进制的颜色
于 2023-03-31 16:40:56 首次发布
function createColor() { let str = '0123456789abcdef' let colors = '#' for (let i = 0; i < 6; i++) { colors += str[Math.floor(Math.random() * 16)] } return colors }