Update palette.go

This commit is contained in:
XoxJlopeZi4BB 2025-05-27 09:57:40 +04:00
parent e161720f1c
commit cf3f8ff3ec

View File

@ -59,7 +59,7 @@ func (c Convert) Bounds() image.Rectangle { return c.Image.Bounds() }
func (c Convert) At(x, y int) color.Color {
if isMeanCloser(c.Palette, c.Image.At(x, y)) {
first, second := twoClosest(c.Palette, c.Image.At(x, y))
// chessboard texture
// bayer matrix 2x2 (chessboard texture)
if (x%2 != 0) && (y%2 != 0) || (x%2 == 0) && (y%2 == 0) {
return first
}