1.封装一个随机函数
function randomTime(max, min) {
let r = Math.floor(Math.random() * (max - min + 1) + min);
let g = Math.floor(Math.random() * (max - min + 1) + min);
let b = Math.floor(Math.random() * (max - min + 1) + min);
return `rgb(${(r, g, b)},${(r, g, b)},${(r, g, b)})`;
}
console.log(randomTime(1, 255));