From a2d496118ed45322f4a4382369544cd96781eda4 Mon Sep 17 00:00:00 2001 From: Brooke Vibber Date: Fri, 23 Aug 2024 21:46:06 -0700 Subject: [PATCH] hmm --- dither-image.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dither-image.js b/dither-image.js index bc963dd..8db870a 100644 --- a/dither-image.js +++ b/dither-image.js @@ -240,6 +240,7 @@ function colorize(input) { let output = zeroes(width); let distance = 0; + let shortest = Infinity; let nextError = new RGB(0, 0, 0); @@ -249,7 +250,7 @@ function colorize(input) { // find the closest possible color // @todo consider doing the difference scoring in luminance and hue spaces - let shortest = Infinity; + shortest = Infinity; let pick = 1; for (let i = 0; i < palette.length; i++) { @@ -276,6 +277,7 @@ function colorize(input) { output, palette, distance, + shortest, error: error.next }; };