Scale numbers to be <= 255?

前端 未结 13 2220
生来不讨喜
生来不讨喜 2021-02-05 18:39

I have cells for whom the numeric value can be anything between 0 and Integer.MAX_VALUE. I would like to color code these cells correspondingly.

If the val

13条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 19:24

    If you are complaining that the low numbers are becoming zero, then you might want to normalize the values to 255 rather than the entire range of the values.

    The formula would become:

    currentValue / (max value of the set)

提交回复
热议问题