Skip to content

feat: add CAD monochrome plot mode - #244

Open
brownie-cake wants to merge 16 commits into
mainfrom
feature/issue-213-monochrome-cad
Open

feat: add CAD monochrome plot mode#244
brownie-cake wants to merge 16 commits into
mainfrom
feature/issue-213-monochrome-cad

Conversation

@brownie-cake

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

Copy link
Copy Markdown
Collaborator

Summary

Closes #213.

Adds a real CAD color-mode integration instead of applying a CSS filter.

  • adds public cad.colorMode, cad.monochromeColor and cad.showColorModeToggle options
  • adds a CAD toolbar toggle between authored colors and monochrome plot output
  • defaults monochrome output to true black (#000000) while supporting a custom fixed color
  • forwards the mode to @flyfish-dev/cad-viewer through its runtime setColorMode() API
  • records the active color policy in File Viewer view-state events
  • updates layer swatches while monochrome mode is active
  • keeps layer visibility updates on the parser-owned source document rather than the render-only color-policy view
  • adds Chinese, English, Japanese and German toolbar labels
  • documents the API and adds executable integration regression checks

Engine dependencies

This is a stacked integration PR. Merge/release the engine prerequisites before updating the File Viewer CAD dependency:

  1. feat: add non-destructive monochrome color rendering dwf-viewer#2 — native DWF/DWFx/XPS fixed-color rendering
  2. feat: add monochrome CAD plot color mode cad-viewer#1 — shared Canvas2D/WebGL/text/entity color policy
  3. this PR — File Viewer configuration, toolbar and view-state integration

The toolbar detects whether the installed CAD engine exposes setColorMode() and disables itself rather than silently applying an incorrect CSS fallback when used with an older engine build.

Validation

Latest head 0192fa7ab20f3525db64f2e1eecd30b035dca0e4 passes:

  • Security
  • complete Public CI build
  • CAD color-mode integration assertions
  • TypeScript type-check
  • package tests and documentation build
  • Vue toolbar contracts and Chromium checks
  • untrusted renderer sanitization
  • browser smoke
  • PPTX slideshow regression

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