js 代码收藏
![0823dd54564e9258dbbe38929382d158cdbf4ec7.jpg][1] js 颜色渐变 function GetColor(val,tt) { if(tt>1){ tt = tt-1; } var one = (255 + 255) / tt; var r = 0, g = 0, b = 0; if (val < tt/2) { r = (one * val); g = 255; } else if (val >= tt/2 && val < tt) { r = 255; g = 255 - ((val - tt/2) * one); } else { r = 255; } return 'rgb(' + r + ', ' + g + ', ' + b + ')'; } var ss = 'js获取渐变颜色,效果演示' for(var i=0;i<ss....