Skip to content

ipuz: carry shaded and highlighted squares - #619

Merged
mdirolf merged 1 commit into
crosshare-org:masterfrom
alexdej:ipuz-shading
Nov 30, 2026
Merged

mdirolf merged 1 commit into
crosshare-org:masterfrom
alexdej:ipuz-shading

Conversation

@alexdej

@alexdej alexdej commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The .ipuz download (exportIpuz) writes circles but drops the other cell styles, so a puzzle's shaded squares and highlight colors are missing from the file. We found this archiving puzzles from Crosshare: a couple of themed puzzles came through with their shading gone, and the clues that pointed at it made no sense.

This writes them with ipuz's own style keys:

  • shade → "highlight": true
  • a highlight color ('#eb984e') → "color": "eb984e" (ipuz writes six hex digits with no #)

importIpuz reads them back the same way, so an ipuz round trip keeps them. A color given as a palette number has no Crosshare equivalent and is skipped. ipuz has one color per cell; the builder sets one highlight at a time, so if a cell somehow has two, the first is written.

Tests: a styled fixture in the ipuz round-trip cases, plus an import test and an export test.

🤖 Generated with Claude Code

exportIpuz wrote circles only, so a puzzle's shade and highlight colors
were lost from the .ipuz download. Shade is now written as
style.highlight and a highlight color as style.color (six hex digits,
no '#'). importIpuz reads them back, so an ipuz round trip keeps them.
@mdirolf
mdirolf merged commit a468d3e into crosshare-org:master Nov 30, 2026
1 check passed
@mdirolf

mdirolf commented Nov 30, 2026

Copy link
Copy Markdown
Member

Looks good - thanks!

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.

2 participants