fix: correct OOXML theme color tint/shade resolution#270
Merged
jedrazb merged 3 commits intoeigenpal:mainfrom Apr 17, 2026
Merged
fix: correct OOXML theme color tint/shade resolution#270jedrazb merged 3 commits intoeigenpal:mainfrom
jedrazb merged 3 commits intoeigenpal:mainfrom
Conversation
|
@sted is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
Covers the tint/shade math fix and the theme color threading through toProseDoc to table cell backgroundColor attrs. Uses real-world tint values (33, 99, F2) from documents with themed table styles.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jedrazb
added a commit
that referenced
this pull request
Apr 17, 2026
Adds `resolveColorToHex` as the single shared helper for converting any `ColorValue` (rgb or themeColor+tint/shade) to a display-ready hex string, with consistent handling of transparent/auto and missing-theme cases. Applies it at every display-side call site so `themeFill`/`themeColor` with `themeTint`/`themeShade` is honored everywhere, not just on table cells: - `toProseDoc.ts` — replaces the inline resolution added in #270. - `toFlowBlocks.ts` — paragraph shading now resolves themed fills (previously read `.fill.rgb` directly, silently dropping themed paragraph backgrounds). - `clipboard.ts` — HTML copy now honors themed text color and shading when a theme is threaded through `ClipboardOptions`/`useClipboard` options. Tests: +20 new pass (357 → 377 total), covering helper edge cases, paragraph themed-shading end-to-end (Document → PM → flow blocks), and clipboard HTML with themed runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
colorResolver.ts: replaced HSL-based approach with the OOXML per-channel linear interpolation specified in ECMA-376 §17.3.2.41. The previous formula produced incorrect intermediate colors (e.g., a 20% tint of dark blue produced medium blue instead of very light blue).toProseDoc.ts: table cells using theme fills (e.g.,themeFill="accent1"with tint/shade modifiers) were rendering with no background because only thergbproperty was checked, ignoring theme color references. Now threads the document theme through the conversion and callsresolveColor().colorResolver.test.ts— coversresolveColorwith real-world tint/shade values (`33`, `99`, `F2`) and edge cases (`FF` = no change, `00` = fully white/black).toProseDoc.test.ts(new) — integration tests verifying that themed cell shading resolves to correct `backgroundColor` attrs on PM nodes.Before / After
Table header rows and section rows using theme colors (common in Word's built-in table styles) now render with correct backgrounds instead of white.
Test plan