JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id='canvas' width='200' height='200'></canvas>a
JavaScript
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
// Make a texture to store the random data
var texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
var data = new Uint16Array(4);
var halfFloat = gl.getExtension('OES_texture_half_float');
// Load the data into the texture
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, halfFloat.HALF_FLOAT_OES, data);