MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getColorData

Function getColorData

libs/mapv/mapv.js:1470–1478  ·  view source on GitHub ↗
(color)

Source from the content-addressed store, hash-verified

1468}
1469
1470function getColorData(color) {
1471 var tmpCanvas = document.createElement('canvas');
1472 var tmpCtx = tmpCanvas.getContext('2d');
1473 tmpCanvas.width = 1;
1474 tmpCanvas.height = 1;
1475 tmpCtx.fillStyle = color;
1476 tmpCtx.fillRect(0, 0, 1, 1);
1477 return tmpCtx.getImageData(0, 0, 1, 1).data;
1478}
1479
1480var vs_s = ['attribute vec4 a_Position;', 'void main() {', 'gl_Position = a_Position;', 'gl_PointSize = 30.0;', '}'].join('');
1481

Callers 3

draw$2Function · 0.85
draw$3Function · 0.85
draw$4Function · 0.85

Calls 2

createElementMethod · 0.80
getContextMethod · 0.45

Tested by

no test coverage detected