JS根据数值大小返回不同色值(数值越大,颜色越深)

//从数组中获取最大值和最小值 let max = Math.max.apply(null, counts); let min = Math.min.apply(null, counts); //根据数值大小返回颜色值的深浅 //n代表数值,方法用在数组遍历时 function getColor(min,max,n) { if(max == min){ if(n>0){ return ‘rgb(2
相关文章
相关标签/搜索