UNPKG
glam
Version:
latest (5.0.1)
5.0.1
4.0.5
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.0.0
2.1.1
2.0.0
1.0.0
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.0
Experimental WebGL Engine
github.com/glamjs/glam
glamjs/glam
glam
/
tests
/
read-pixel.js
6 lines
(5 loc)
•
184 B
JavaScript
View Raw
1
2
3
4
5
6
export
default
function
readPixel
(
gl, x, y
) {
var
pixel =
new
Uint8Array
(
4
) gl.
readPixels
( x, y,
1
,
1
, gl.
RGBA
, gl.
UNSIGNED_BYTE
, pixel )
return
[pixel[
0
], pixel[
1
], pixel[
2
]] }