()
| 478 | this.splitChannel = ranges.indexOf(this.largestRange); |
| 479 | } |
| 480 | getAverageColor() { |
| 481 | const sum = this.pixels.reduce((a, b) => a.map((v, i) => v + b[i]), [0,0,0,0]); |
| 482 | return sum.map(v => Math.round(v / this.pixels.length)); |
| 483 | } |
| 484 | split() { |
| 485 | if (this.pixels.length < 2) return null; |
| 486 | this.pixels.sort((a, b) => a[this.splitChannel] - b[this.splitChannel]); |
no outgoing calls
no test coverage detected