//生成随机颜色值
function fn1(){
return '#' + Math.floor( Math.random() * 0xffffff ).toString(16);
}
function fn2(){
return '#' + ( Math.random() * 0xffffff<<0 ).toString(16);
}
function fn3(){
var r = Math.floor( Math.random() * 256 );
var g = Math.floor( Math.random() * 256 );
var b = Math.floor( Math.random() * 256 );
return "rgb("+r+','+g+','+b+")";
}
function fn4(){
var color = "#";
for( var i = 0; i < 6; i++ ){
color += ( Math.random()*16 | 0 ).toString(16);
}
return color;
}
function fn5(){
var colorValue = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f";
var colorArray = colorValue.split(",");
var color = "#";
for( var i = 0; i < 6; i++ ){
color += colorArray[ Math.floor( Math.random() * 16 ) ];
}
return color;
}
===========参考别人=============