{
const canvas = this||html`<canvas width=${width} height=400></canvas>`;
yield canvas;
const gl = canvas.getContext('webgl');
const vertexShader = createShader(gl,gl.VERTEX_SHADER,vertexShaderRectCode.code);
const fragmentShader = createShader(gl,gl.FRAGMENT_SHADER,fragmentShaderRectCode.code);
const program = createProgram(gl,vertexShader, fragmentShader);
var positionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
setRectGeometry(gl);
var colorBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);
setColorsGrad(gl)
var translation = [r2.x, r2.y];
var angleInRadians = r2.angle;
var scale = [r2.scaleX, r2.scaleY];
drawSceneRectColor(gl, program,positionBuffer, translation, angleInRadians,scale, colorBuffer )
invalidation.then(d=>{
gl.deleteProgram(program);
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
})
}