mirror of
https://github.com/ShinkoNet/Wplace-Overlay-Pro.git
synced 2026-05-07 16:50:46 +00:00
perf: remove unnecssary Math.sqrt for comparision
This commit is contained in:
parent
7c02beed51
commit
e6dc50381f
1 changed files with 1 additions and 1 deletions
|
|
@ -243,7 +243,7 @@ function weightedNearest(r: number, g: number, b: number, palette: number[][]) {
|
|||
const x = (512 + rmean) * rdiff * rdiff >> 8;
|
||||
const y = 4 * gdiff * gdiff;
|
||||
const z = (767 - rmean) * bdiff * bdiff >> 8;
|
||||
const dist = Math.sqrt(x + y + z);
|
||||
const dist = x + y + z;
|
||||
if (dist < bestDist) { bestDist = dist; best = [pr, pg, pb]; }
|
||||
}
|
||||
return best || [0,0,0];
|
||||
|
|
|
|||
Loading…
Reference in a new issue