d in the range 1.5 to 3.5
1. subtract 1.5 from d
d now in the range 0 to 2
2. divide by 2
d now in the range 0 to 1
3. perform d = 1 - d
d now in the range 1 to 0
4. multiply by 255
d now in the range 255 to 0
↧