MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / withAlpha

Function withAlpha

src/core/createRenderCoordinator.ts:575–580  ·  view source on GitHub ↗
(cssColor: string, alphaMultiplier: number)

Source from the content-addressed store, hash-verified

573};
574
575const withAlpha = (cssColor: string, alphaMultiplier: number): string => {
576 const parsed = parseCssColorToRgba01(cssColor);
577 if (!parsed) return cssColor;
578 const a = Math.max(0, Math.min(1, parsed[3] * alphaMultiplier));
579 return rgba01ToCssRgba([parsed[0], parsed[1], parsed[2], a]);
580};
581
582/**
583 * Estimates the maximum width of Y-axis tick labels in CSS pixels.

Callers 1

renderFunction · 0.85

Calls 2

parseCssColorToRgba01Function · 0.90
rgba01ToCssRgbaFunction · 0.85

Tested by

no test coverage detected