()
| 148 | this.splitChannel = Lr >= ar && Lr >= br ? 0 : ar >= br ? 1 : 2; |
| 149 | } |
| 150 | getAvgRgb() { |
| 151 | const n = this.pixels.length; |
| 152 | let L = 0, a = 0, b = 0; |
| 153 | for (const p of this.pixels) { L += p[0]; a += p[1]; b += p[2]; } |
| 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; |
no test coverage detected