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

Function extractTxPrColor

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

* Extract text color from a txPr element: txPr > p > pPr > defRPr > solidFill.

(parentNode: SafeXmlNode, ctx: RenderContext)

Source from the content-addressed store, hash-verified

454 * Extract text color from a txPr element: txPr > p > pPr > defRPr > solidFill.
455 */
456function extractTxPrColor(parentNode: SafeXmlNode, ctx: RenderContext): string | undefined {
457 const txPr = parentNode.child('txPr')
458 if (!txPr.exists()) return undefined
459 for (const p of txPr.children('p')) {
460 const pPr = p.child('pPr')
461 if (!pPr.exists()) continue
462 const defRPr = pPr.child('defRPr')
463 if (!defRPr.exists()) continue
464 const fill = defRPr.child('solidFill')
465 if (fill.exists()) {
466 return resolveColorToHex(fill, ctx)
467 }
468 }
469 return undefined
470}
471
472/**
473 * Parse c:dLbls (data labels) configuration from a chart type node or series.

Callers 2

parseDataLabelsFunction · 0.85

Calls 4

resolveColorToHexFunction · 0.85
childMethod · 0.80
existsMethod · 0.80
childrenMethod · 0.80

Tested by

no test coverage detected