//浅色
var getRandomColor = function() {
return '#' +
(function(color) {
return(color += '0123401234abcabc' [Math.floor(Math.random() * 16)]) &&
(color.length == 6) ? color : arguments.callee(color);
})('');
}
//深色
var getRandomColor = function() {
return '#' +
(function(color) {
return(color += '5678956789defdef' [Math.floor(Math.random() * 16)]) &&
(color.length == 6) ? color : arguments.callee(color);
})('');
}
js随机颜色(深色and浅色)
最新推荐文章于 2024-02-05 16:20:20 发布