* Extract a hex color value from a color definition node. * Handles both `a:srgbClr@val` and `a:sysClr@lastClr`.
(node: SafeXmlNode)
| 34 | * Handles both `a:srgbClr@val` and `a:sysClr@lastClr`. |
| 35 | */ |
| 36 | function 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. |
no test coverage detected