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

Function parseCssColorToGPUColor

src/utils/colors.ts:146–154  ·  view source on GitHub ↗
(
  color: string,
  fallback: GPUColor = { r: 0, g: 0, b: 0, a: 1 }
)

Source from the content-addressed store, hash-verified

144};
145
146export const parseCssColorToGPUColor = (
147 color: string,
148 fallback: GPUColor = { r: 0, g: 0, b: 0, a: 1 }
149): GPUColor => {
150 const rgba = parseCssColorToRgba01(color);
151 if (!rgba) return fallback;
152 const [r, g, b, a] = rgba;
153 return { r, g, b, a };
154};
155

Callers 1

renderFunction · 0.90

Calls 1

parseCssColorToRgba01Function · 0.85

Tested by

no test coverage detected