Update palette.go
This commit is contained in:
parent
e161720f1c
commit
cf3f8ff3ec
@ -59,7 +59,7 @@ func (c Convert) Bounds() image.Rectangle { return c.Image.Bounds() }
|
|||||||
func (c Convert) At(x, y int) color.Color {
|
func (c Convert) At(x, y int) color.Color {
|
||||||
if isMeanCloser(c.Palette, c.Image.At(x, y)) {
|
if isMeanCloser(c.Palette, c.Image.At(x, y)) {
|
||||||
first, second := twoClosest(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) {
|
if (x%2 != 0) && (y%2 != 0) || (x%2 == 0) && (y%2 == 0) {
|
||||||
return first
|
return first
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user