Skip to content

fix(pptx): resolve theme colours in persisted custGeom (brand-coloured vectors round-trip cross-process)#71

Merged
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/fix-custgeom-schemeclr
May 31, 2026
Merged

fix(pptx): resolve theme colours in persisted custGeom (brand-coloured vectors round-trip cross-process)#71
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/fix-custgeom-schemeclr

Conversation

@karthikmudunuri
Copy link
Copy Markdown
Member

Follow-up to #69. Closes the gap that left the eon bicycle blank even in 1.16.1, which already shipped cross-process verbatim persistence.

Why the bicycle still blanked in 1.16.1

#69 only stamps a custGeom shape's verbatim <p:sp> into the deck JSON when the XML is fully self-contained, and it excluded any <a:schemeClr> (theme colour) reference. Brand marks are almost always filled with a theme accent — E.ON red is schemeClr val="accent2" — so the bicycle was gated out, fell back to the lossy synth path, and still rendered blank. The deck JSON shows fill: "#EA1B0A" because the importer resolves the colour for the fill field, but the verbatim XML kept the original schemeClr, which is what the gate rejected.

Fix

Instead of bailing on schemeClr, the importer now resolves it to a literal <a:srgbClr> against the slide's theme before persisting:

  • <a:schemeClr val="accent2"/><a:srgbClr val="EA1B0A"/>
  • schemeClr and srgbClr accept the same child transforms (lumMod, lumOff, alpha, …), so the swap is lossless — tints/shades survive, only the colour source changes from theme-ref to baked hex.
  • The fragment is then valid without the source theme → qualifies for verbatim replay → renders exactly like the source (sidestepping the synth even-odd/winding loss entirely).

Shapes that still reference media (r:embed/r:id/r:link) or a colour token absent from the theme (e.g. phClr) remain on the synth path — the resolver leaves those untouched and the existing "still has schemeClr → bail" check catches them.

Tests (+1, 62 pass)

Unit test on the resolver: self-closing / with-child-transform / closing-tag forms all convert; child lumMod survives; unresolvable phClr is left intact; no schemeClr refs remain for resolved tokens. The existing pristineOoxml stamp + verbatim-replay + edited-fallback tests still pass.

tsc -b clean, build:lib succeeds. Off current main (post-1.16.1).

Net effect

With #66 (synth path-space + drop fill="darken"), #69 (verbatim persistence), and this, an unedited brand-coloured custGeom vector round-trips byte-faithfully cross-process. If the bicycle still blanks after a release with this, it would have to be media-referencing or genuinely renderer-side — send eon-deck.pptx and I'll confirm against the built package.

@karthikmudunuri karthikmudunuri merged commit 71f96cb into main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant