Comparing version 3.0.0-beta.4 to 3.0.0-beta.5
{ | ||
"name": "sigma", | ||
"version": "3.0.0-beta.4", | ||
"version": "3.0.0-beta.5", | ||
"description": "A JavaScript library aimed at visualizing graphs of thousands of nodes and edges.", | ||
@@ -121,3 +121,3 @@ "homepage": "https://www.sigmajs.org", | ||
}, | ||
"gitHead": "a4a68930be9319e032a17af157c18393b01f1ec5" | ||
"gitHead": "bc606b13774d2123251d5b7fa0c319d79fab693e" | ||
} |
@@ -296,2 +296,5 @@ /** | ||
export function floatColor(val: string): number { | ||
// The html color names are case-insensitive | ||
val = val.toLowerCase(); | ||
// If the color is already computed, we yield it | ||
@@ -298,0 +301,0 @@ if (typeof FLOAT_COLOR_CACHE[val] !== "undefined") return FLOAT_COLOR_CACHE[val]; |
@@ -6,17 +6,14 @@ export function getPixelColor( | ||
y: number, | ||
downSizingRatio = 1, | ||
pixelRatio: number, | ||
downSizingRatio: number, | ||
): [number, number, number, number] { | ||
const bufferX = Math.floor((x / downSizingRatio) * pixelRatio); | ||
const bufferY = Math.floor(gl.drawingBufferHeight / downSizingRatio - (y / downSizingRatio) * pixelRatio); | ||
const pixel = new Uint8Array(4); | ||
gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); | ||
gl.readPixels( | ||
x / downSizingRatio, | ||
gl.drawingBufferHeight / downSizingRatio - y / downSizingRatio, | ||
1, | ||
1, | ||
gl.RGBA, | ||
gl.UNSIGNED_BYTE, | ||
pixel, | ||
); | ||
gl.readPixels(bufferX, bufferY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); | ||
const [r, g, b, a] = pixel; | ||
return [r, g, b, a]; | ||
} |
@@ -272,2 +272,4 @@ "use strict"; | ||
function floatColor(val) { | ||
// The html color names are case-insensitive | ||
val = val.toLowerCase(); | ||
// If the color is already computed, we yield it | ||
@@ -274,0 +276,0 @@ if (typeof FLOAT_COLOR_CACHE[val] !== "undefined") |
@@ -1,1 +0,1 @@ | ||
export declare function getPixelColor(gl: WebGLRenderingContext, frameBuffer: WebGLBuffer | null, x: number, y: number, downSizingRatio?: number): [number, number, number, number]; | ||
export declare function getPixelColor(gl: WebGLRenderingContext, frameBuffer: WebGLBuffer | null, x: number, y: number, pixelRatio: number, downSizingRatio: number): [number, number, number, number]; |
@@ -20,7 +20,8 @@ "use strict"; | ||
exports.getPixelColor = void 0; | ||
function getPixelColor(gl, frameBuffer, x, y, downSizingRatio) { | ||
if (downSizingRatio === void 0) { downSizingRatio = 1; } | ||
function getPixelColor(gl, frameBuffer, x, y, pixelRatio, downSizingRatio) { | ||
var bufferX = Math.floor((x / downSizingRatio) * pixelRatio); | ||
var bufferY = Math.floor(gl.drawingBufferHeight / downSizingRatio - (y / downSizingRatio) * pixelRatio); | ||
var pixel = new Uint8Array(4); | ||
gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); | ||
gl.readPixels(x / downSizingRatio, gl.drawingBufferHeight / downSizingRatio - y / downSizingRatio, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); | ||
gl.readPixels(bufferX, bufferY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); | ||
var _a = __read(pixel, 4), r = _a[0], g = _a[1], b = _a[2], a = _a[3]; | ||
@@ -27,0 +28,0 @@ return [r, g, b, a]; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8934090
288516