()
| 68 | this.splitChannel = rRange >= gRange && rRange >= bRange ? 0 : gRange >= bRange ? 1 : 2; |
| 69 | } |
| 70 | getAvg() { |
| 71 | const n = this.pixels.length; |
| 72 | let r = 0, g = 0, b = 0; |
| 73 | for (const p of this.pixels) { r += p[0]; g += p[1]; b += p[2]; } |
| 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; |
no outgoing calls
no test coverage detected