MCPcopy
hub / github.com/opentrace/opentrace / getCircleTexture

Function getCircleTexture

ui/src/components/pixi/spriteTextures.ts:36–51  ·  view source on GitHub ↗
(
  app: Application,
  color: string,
  cache: Map<string, Texture>,
)

Source from the content-addressed store, hash-verified

34 * live renderers.
35 */
36export function getCircleTexture(
37 app: Application,
38 color: string,
39 cache: Map<string, Texture>,
40): Texture {
41 const cached = cache.get(color);
42 if (cached) return cached;
43
44 const g = new Graphics();
45 g.circle(CIRCLE_RADIUS, CIRCLE_RADIUS, CIRCLE_RADIUS);
46 g.fill({ color });
47 const tex = app.renderer.generateTexture(g);
48 g.destroy();
49 cache.set(color, tex);
50 return tex;
51}
52
53const GLOW_RADIUS = 48; // outer radius of the glow texture
54const GLOW_RINGS = 8; // number of concentric rings to simulate gradient

Callers 3

setDataMethod · 0.90
addDataMethod · 0.90
updateNodeColorsMethod · 0.90

Calls 2

destroyMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected