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

Function extractColor

apps/sim/lib/pptx-renderer/model/theme.ts:36–46  ·  view source on GitHub ↗

* Extract a hex color value from a color definition node. * Handles both `a:srgbClr@val` and `a:sysClr@lastClr`.

(node: SafeXmlNode)

Source from the content-addressed store, hash-verified

34 * Handles both `a:srgbClr@val` and `a:sysClr@lastClr`.
35 */
36function extractColor(node: SafeXmlNode): string | undefined {
37 const srgb = node.child('srgbClr')
38 if (srgb.exists()) {
39 return srgb.attr('val')
40 }
41 const sys = node.child('sysClr')
42 if (sys.exists()) {
43 return sys.attr('lastClr') ?? sys.attr('val')
44 }
45 return undefined
46}
47
48/**
49 * Parse font info from a majorFont or minorFont node.

Callers 1

parseThemeFunction · 0.85

Calls 3

childMethod · 0.80
existsMethod · 0.80
attrMethod · 0.80

Tested by

no test coverage detected