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

Function resolveAnnotationRgba

src/core/createRenderCoordinator.ts:3392–3399  ·  view source on GitHub ↗
(color: string | undefined, opacity: number | undefined)

Source from the content-addressed store, hash-verified

3390 const plotHeightCss = Math.max(0, plotBottomCss - plotTopCss);
3391
3392 const resolveAnnotationRgba = (color: string | undefined, opacity: number | undefined): readonly [number, number, number, number] => {
3393 const base =
3394 parseCssColorToRgba01(color ?? currentOptions.theme.textColor) ??
3395 parseCssColorToRgba01(currentOptions.theme.textColor) ??
3396 ([1, 1, 1, 1] as const);
3397 const o = opacity == null ? 1 : clamp01(opacity);
3398 return [clamp01(base[0]), clamp01(base[1]), clamp01(base[2]), clamp01(base[3] * o)] as const;
3399 };
3400
3401 const annotations: ReadonlyArray<AnnotationConfig> = hasCartesianSeries ? (currentOptions.annotations ?? []) : [];
3402

Callers 1

renderFunction · 0.85

Calls 2

parseCssColorToRgba01Function · 0.90
clamp01Function · 0.70

Tested by

no test coverage detected