()
| 154 | return labToRgb(L / n, a / n, b / n); |
| 155 | } |
| 156 | split() { |
| 157 | if (this.pixels.length < 2) return null; |
| 158 | const ch = this.splitChannel; |
| 159 | this.pixels.sort((a, b) => a[ch] - b[ch]); |
| 160 | const mid = Math.floor(this.pixels.length / 2); |
| 161 | return [new LabBox(this.pixels.slice(0, mid)), new LabBox(this.pixels.slice(mid))]; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | let boxes = [new LabBox(labPixels)]; |
no outgoing calls
no test coverage detected