Skip to content

Backport Excel theme tint color matching to v2 - #9

Merged
developer0hye merged 1 commit into
fix/panic-safety-v2from
fix/panic-safety-v2-theme-tint
Aug 29, 2026
Merged

Backport Excel theme tint color matching to v2#9
developer0hye merged 1 commit into
fix/panic-safety-v2from
fix/panic-safety-v2-theme-tint

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Problem

The office2pdf v2 dependency resolves positive theme tints through a floating-point 255-step HLS space. Native Excel uses integer 240-step HLS behavior, which makes DAB6BA at tint 0.7999 resolve to F8EFF0 rather than F8F0F1.

Fix

Backport the theme tint correction from MathNya#360 while retaining the v2 public API:

  • use the 240-step integer HLS conversion
  • recover near-whole-percent encoded tint values within one signed-short step
  • preserve arbitrary tint precision outside that threshold
  • truncate adjusted luminance before the reverse conversion
  • update native fixture expectations and add direct regression tests

Testing

  • rustfmt +nightly --edition 2018 --check src/helper/color.rs tests/integration_test.rs
  • cargo clippy -- -D warnings
  • cargo test (41 unit, 97 integration)

Related: MathNya#360
Related: developer0hye/office2pdf#1394

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 15406d8 into fix/panic-safety-v2 Aug 29, 2026
1 check passed
@developer0hye
developer0hye deleted the fix/panic-safety-v2-theme-tint branch August 29, 2026 23:25
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