(e)
| 123 | } |
| 124 | |
| 125 | getPaletteColorAtPoint(e) { |
| 126 | let x = e.clientX - this.canvas.documentOffsetLeft; |
| 127 | let y = e.clientY - this.canvas.documentOffsetTop; |
| 128 | x = (x < 1 && 1) || x; |
| 129 | y = (y < 1 && 1) || y; |
| 130 | x = (x > this.w && this.w - 1) || x; |
| 131 | y = (y > this.h && this.h - 1) || y; |
| 132 | const p = this.ctx.getImageData(x, y, 1, 1).data; |
| 133 | this.palleteColor = rgbToHex(p[0], p[1], p[2]); |
| 134 | this.drawLighter(); |
| 135 | this.regetColor(); |
| 136 | } |
| 137 | |
| 138 | regetColor() { |
| 139 | const p = this.ctxLight.getImageData(this.lightPosition, 5, 1, 1).data; |
no test coverage detected