This commit is contained in:
Brooke Vibber 2024-08-23 21:46:06 -07:00
parent f4fd016199
commit a2d496118e

View file

@ -240,6 +240,7 @@ function colorize(input) {
let output = zeroes(width); let output = zeroes(width);
let distance = 0; let distance = 0;
let shortest = Infinity;
let nextError = new RGB(0, 0, 0); let nextError = new RGB(0, 0, 0);
@ -249,7 +250,7 @@ function colorize(input) {
// find the closest possible color // find the closest possible color
// @todo consider doing the difference scoring in luminance and hue spaces // @todo consider doing the difference scoring in luminance and hue spaces
let shortest = Infinity; shortest = Infinity;
let pick = 1; let pick = 1;
for (let i = 0; i < palette.length; i++) { for (let i = 0; i < palette.length; i++) {
@ -276,6 +277,7 @@ function colorize(input) {
output, output,
palette, palette,
distance, distance,
shortest,
error: error.next error: error.next
}; };
}; };