(col color.Color)
| 191 | } |
| 192 | |
| 193 | func rgbaColor(col color.Color) color.RGBA { |
| 194 | r, g, b, a := col.RGBA() |
| 195 | // RGBA returns an alpha-premultiplied color so that c <= a. We silently correct the color by clipping r,g,b to a |
| 196 | if a < r { |
| 197 | r = a |
| 198 | } |
| 199 | if a < g { |
| 200 | g = a |
| 201 | } |
| 202 | if a < b { |
| 203 | b = a |
| 204 | } |
| 205 | return color.RGBA{uint8(r >> 8), uint8(g >> 8), uint8(b >> 8), uint8(a >> 8)} |
| 206 | } |
| 207 | |
| 208 | //////////////////////////////////////////////////////////////// |
| 209 |
no test coverage detected