()
| 74 | return [Math.round(r / n), Math.round(g / n), Math.round(b / n)]; |
| 75 | } |
| 76 | split() { |
| 77 | if (this.pixels.length < 2) return null; |
| 78 | const ch = this.splitChannel; |
| 79 | this.pixels.sort((a, b) => a[ch] - b[ch]); |
| 80 | const mid = Math.floor(this.pixels.length / 2); |
| 81 | return [new ColorBox(this.pixels.slice(0, mid)), new ColorBox(this.pixels.slice(mid))]; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | let boxes = [new ColorBox(pixels)]; |
nothing calls this directly
no outgoing calls
no test coverage detected