Skip to content

Commit

Permalink
Merge pull request #16 from nobodypb/patch-1
Browse files Browse the repository at this point in the history
Fixed issues in MMCQ
  • Loading branch information
lokesh committed Jul 29, 2013
2 parents 355a511 + 21d3f14 commit e1bb8f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/color-thief.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ var MMCQ = (function() {
gval = pixel[1] >> rshift;
bval = pixel[2] >> rshift;
return (rval >= vbox.r1 && rval <= vbox.r2 &&
gval >= vbox.g1 && rval <= vbox.g2 &&
bval >= vbox.b1 && rval <= vbox.b2);
gval >= vbox.g1 && gval <= vbox.g2 &&
bval >= vbox.b1 && bval <= vbox.b2);
}
};

Expand Down Expand Up @@ -373,7 +373,7 @@ var MMCQ = (function() {
d2 = Math.sqrt(
Math.pow(color[0] - vboxes.peek(i).color[0], 2) +
Math.pow(color[1] - vboxes.peek(i).color[1], 2) +
Math.pow(color[1] - vboxes.peek(i).color[1], 2)
Math.pow(color[2] - vboxes.peek(i).color[2], 2)
);
if (d2 < d1 || d1 === undefined) {
d1 = d2;
Expand Down Expand Up @@ -610,4 +610,4 @@ var MMCQ = (function() {
return {
quantize: quantize
}
})();
})();

0 comments on commit e1bb8f2

Please sign in to comment.