We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5847506 commit 027c912Copy full SHA for 027c912
pixel/pixel.go
@@ -161,9 +161,9 @@ func (c RGB555) BitsPerPixel() int {
161
162
func (c RGB555) RGBA() color.RGBA {
163
color := color.RGBA{
164
- R: uint8(c>>10) << 3,
165
- G: uint8(c>>5) << 3,
166
- B: uint8(c) << 3,
+ R: (uint8(c) & 0x1F) << 3,
+ G: (uint8(c>>5) & 0x1F) << 3,
+ B: (uint8(c>>10) & 0x1F) << 3,
167
A: 255,
168
}
169
// Correct color rounding, so that 0xff roundtrips back to 0xff.
0 commit comments