js 随机生成颜色值

function getRandomColor(){
	var colorValue = [0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f'];
	var s = "#";
	for (var i=0;i<6;i++) {
		s+=colorValue[Math.floor(Math.random()*16)];
	}
	
	return s;
}

  


posted @ 2018-10-26 15:13  飞尽堂前燕  阅读(409)  评论(0编辑  收藏  举报