hmm
This commit is contained in:
parent
f4fd016199
commit
a2d496118e
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue