( colorNode: SafeXmlNode, ctx: RenderContext )
| 81 | * into a CSS-ready hex color and alpha value. |
| 82 | */ |
| 83 | export 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 | |
| 97 | function resolveColorUncached( |
| 98 | colorNode: SafeXmlNode, |
no test coverage detected