JavaScript JS 随机rgb颜色
function randColor() {
var r = Math.floor(Math.random() * 256)
var g = Math.floor(Math.random() * 256)
var b = Math.floor(Math.random() * 256)
var color = 'rgb($r, $g, $b)'
color = color.replace('$r', r)
color = color.replace('$g', g)
color = color.replace('$b', b)
return color
}
randColor() // 'rgb(96, 156, 217)'
randColor() // 'rgb(148, 143, 221)'
randColor() // 'rgb(71, 212, 206)'