Skip to content

Commit

Permalink
Changed behaviour to fit qr codes better
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowLp174 committed Jul 23, 2023
1 parent 3f21e2b commit 566a591
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/orderUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function getIncorrectPixels(client) {
// this pixel is right
if (r === currentR && g === currentG && b === currentB) continue;

let priority = getPriority(orderPriority.data[i], orderPriority.data[i + 1], orderPriority.data[i + 2], orderPriority.data[i + 3]);
const black = (currentR === 0 && currentG === 0 && currentB === 0);
const reset = ((r === 255 && g === 255 && b === 255) && !black); // white; decrease priority

let priority = (reset) ? 0 : getPriority(orderPriority.data[i], orderPriority.data[i + 1], orderPriority.data[i + 2], orderPriority.data[i + 3]);
priority += Math.floor(Math.random() * 10_000); // increase randomness
wrong.push([[x, y, [r, g, b]], priority]);
}
Expand Down

0 comments on commit 566a591

Please sign in to comment.