From 361c89073a76c6a6f97d3e65f09b607e0d8ed696 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 6 Sep 2023 21:24:01 +0900 Subject: [PATCH] ebiten: bug fix: wrong conversion of 16bit to 8bit color values Closes #2749 --- image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image.go b/image.go index f4f4f2c15..6d53472b4 100644 --- a/image.go +++ b/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.