You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name the repeated colour-swap idioms in pptx for readability (no behaviour change)
The dark-mode post-pass inlined two idioms several times each; give them a name
so the value/expression lives in one place:
- _rgb_key(rgb): the (int(rgb[0]), int(rgb[1]), int(rgb[2])) tuple used as the
light->dark map key — was inlined 3x across _swap_fill / _swap_text_colors.
- _rgb_hex(rgb): the "%02X%02X%02X" srgbClr `val` string — was inlined in the
cell-border drawer and the border-recolour pass.
- _DARK_BODY_TEXT: the #E5E7EB near-white dark-mode body colour, promoted from a
per-call local in _swap_text_colors to a module constant beside _DARK_SLIDE_BG
(single source of truth, matching the _BRAND_* / _LIGHT_TO_DARK_TEXT style).
Pure refactor — 601 tests pass unchanged (incl. the dark-mode contract,
no-invisible-runs, and no-red-text regressions that exercise these passes);
ruff + bandit clean.
0 commit comments