We can now go to the offscreen buffer and read the color from the appropriate coordinates:

WebGL allows us to read back from a framebuffer using the readPixels function. As usual, having gl as the WebGL context variable within our context:
Function | Description |
gl.readPixels(x, y, width, height, format, type, pixels) |
|
Remember that...