Skip to content

feat: add monochrome CAD plot color mode - #1

Merged
wybaby168 merged 13 commits into
mainfrom
feature/monochrome-color-mode
Sep 5, 2026
Merged

wybaby168 merged 13 commits into
mainfrom
feature/monochrome-color-mode

Conversation

@brownie-cake

@brownie-cake brownie-cake commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the engine-level monochrome rendering policy requested by flyfish-dev/file-viewer#213.

  • adds colorMode: 'source' | 'monochrome' and monochromeColor to CadViewer
  • adds runtime setColorMode(), getColorMode() and getMonochromeColor() APIs
  • applies one fixed render color through the shared entity/layer color resolver, covering Canvas2D, retained WebGL buffers, text overlays, fills and ByBlock inheritance
  • preserves source documents, entity colors, geometry, line types, line weights, visibility and alpha
  • rebuilds only the render scene when switching policy while retaining the active view
  • forwards the policy to the native DWF/DWFx/XPS viewer when supported
  • adds regression tests and API documentation

Native DWF dependency

Native DWF/DWFx/XPS color overriding is implemented in flyfish-dev/dwf-viewer#2.

File Viewer integration

The public File Viewer options and toolbar toggle are implemented in flyfish-dev/file-viewer#244, which closes flyfish-dev/file-viewer#213.

Validation

Latest head 393c33840c2e0ef2270e511af17f2b53f9c824b7 passes both repository CI workflows. The checks cover the complete library/demo build, regression tests—including source immutability, alpha preservation, ACI preservation and ByBlock alpha handling—and package dry-run.

@wybaby168
wybaby168 merged commit a1bb148 into main Sep 5, 2026
2 checks 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.

[feature]: 希望增加黑白线条界面

2 participants