MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / labDistanceSq

Function labDistanceSq

web/js/algorithms.js:29–31  ·  view source on GitHub ↗
(lab1, lab2)

Source from the content-addressed store, hash-verified

27}
28
29function labDistanceSq(lab1, lab2) {
30 return (lab1[0] - lab2[0]) ** 2 + (lab1[1] - lab2[1]) ** 2 + (lab1[2] - lab2[2]) ** 2;
31}
32
33function buildLabPalette(palette) {
34 return palette.map(c => ({ rgb: c, lab: rgbToLab(c[0], c[1], c[2]) }));

Callers 1

nearestLabColorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected