mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: bug fix: wrong conversion of 16bit to 8bit color values
Closes #2749
This commit is contained in:
parent
55bfc02509
commit
361c89073a
2
image.go
2
image.go
@ -963,7 +963,7 @@ func (i *Image) Set(x, y int, clr color.Color) {
|
||||
|
||||
dx, dy := i.adjustPosition(x, y)
|
||||
cr, cg, cb, ca := clr.RGBA()
|
||||
i.image.WritePixels([]byte{byte(cr / 0x101), byte(cg / 0x101), byte(cb / 0x101), byte(ca / 0x101)}, image.Rect(dx, dy, dx+1, dy+1))
|
||||
i.image.WritePixels([]byte{byte(cr >> 8), byte(cg >> 8), byte(cb >> 8), byte(ca >> 8)}, image.Rect(dx, dy, dx+1, dy+1))
|
||||
}
|
||||
|
||||
// Dispose disposes the image data.
|
||||
|
Loading…
Reference in New Issue
Block a user