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

Function parseColorSlot

apps/sim/lib/copilot/vfs/document-style.ts:73–82  ·  view source on GitHub ↗
(xml: string, slot: string)

Source from the content-addressed store, hash-verified

71}
72
73function parseColorSlot(xml: string, slot: string): string {
74 const inner = between(xml, `<a:${slot}>`, `</a:${slot}>`)
75 if (!inner) return ''
76 // srgbClr uses val=; sysClr has val="windowText" but lastClr holds the fallback hex
77 const srgb = attr(inner, 'val')
78 if (srgb && inner.includes('<a:srgbClr')) return srgb.toUpperCase()
79 const lastClr = attr(inner, 'lastClr')
80 if (lastClr) return lastClr.toUpperCase()
81 return ''
82}
83
84function parseFontScheme(xml: string): { major: string; minor: string } {
85 const major = between(xml, '<a:majorFont>', '</a:majorFont>')

Callers 1

parseThemeXmlFunction · 0.85

Calls 2

betweenFunction · 0.85
attrFunction · 0.85

Tested by

no test coverage detected