MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveColorToHex

Function resolveColorToHex

apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts:280–287  ·  view source on GitHub ↗

* Resolve a color from a fill node (solidFill) to a hex string.

(fillNode: SafeXmlNode, ctx: RenderContext)

Source from the content-addressed store, hash-verified

278 * Resolve a color from a fill node (solidFill) to a hex string.
279 */
280function resolveColorToHex(fillNode: SafeXmlNode, ctx: RenderContext): string | undefined {
281 try {
282 const { color } = resolveColor(fillNode, ctx)
283 return color.startsWith('#') ? color : `#${color}`
284 } catch {
285 return undefined
286 }
287}
288
289/**
290 * Resolve a color from a single gradient stop node (a:gs > color child) to hex + alpha.

Callers 7

extractSeriesColorFunction · 0.85
extractDataPointColorsFunction · 0.85
extractTxPrColorFunction · 0.85
extractTxPrStyleFunction · 0.85
extractAxisLabelColorFunction · 0.85
extractAxisLineColorFunction · 0.85
extractBackgroundColorsFunction · 0.85

Calls 1

resolveColorFunction · 0.90

Tested by

no test coverage detected