Skip to content

feat: add monochrome CAD plot color mode - #1

Open
brownie-cake wants to merge 13 commits into
mainfrom
feature/monochrome-color-mode
Open

feat: add monochrome CAD plot color mode#1
brownie-cake wants to merge 13 commits into
mainfrom
feature/monochrome-color-mode

Conversation

@brownie-cake

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

Copy link
Copy Markdown

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.

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]: 希望增加黑白线条界面

1 participant