(c float)
| 94 | } |
| 95 | |
| 96 | func CoverageToColor(c float) uint8 { |
| 97 | if c >= 1 { |
| 98 | return 0x00 |
| 99 | } else if c <= 0 { |
| 100 | return 0xFF |
| 101 | } else { |
| 102 | return 0xFF - uint8(0xFF*c) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func main() { |
| 107 | a := Line{Point{100, 100}, Point{213, 217}, 10} |