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

Function resolveColor

apps/sim/lib/pptx-renderer/renderer/style-resolver.ts:83–95  ·  view source on GitHub ↗
(
  colorNode: SafeXmlNode,
  ctx: RenderContext
)

Source from the content-addressed store, hash-verified

81 * into a CSS-ready hex color and alpha value.
82 */
83export function resolveColor(
84 colorNode: SafeXmlNode,
85 ctx: RenderContext
86): { color: string; alpha: number } {
87 // Check cache
88 const cacheKey = buildColorCacheKey(colorNode)
89 const cached = ctx.colorCache.get(cacheKey)
90 if (cached) return cached
91
92 const result = resolveColorUncached(colorNode, ctx)
93 ctx.colorCache.set(cacheKey, result)
94 return result
95}
96
97function resolveColorUncached(
98 colorNode: SafeXmlNode,

Callers 15

renderShapeFunction · 0.90
mergeRunPropsFunction · 0.90
resolveGradientForTextFunction · 0.90
applyDuotoneFilterFunction · 0.90
applyStyleFillFunction · 0.90
applyStyleBordersFunction · 0.90
applyTableBackgroundFunction · 0.90
applyCellPropertiesFunction · 0.90
resolveColorToHexFunction · 0.90
resolveGradientStopFunction · 0.90
renderBgPrFunction · 0.90

Calls 4

buildColorCacheKeyFunction · 0.85
resolveColorUncachedFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected