diagram_contrast
Diagram quality QA. Catch and fix the things that ruin diagrams: (1) unreadable label contrast - POST a mermaid/SVG or HTML diagram, get every WCAG-AA failure (incl. mermaid -block label colors, with unresolvable fills flagged honestly, not false-passed) + auto-corrected colors; (2) harden a mermaid SOURCE before it renders - rewrites every fill/label pair and remaps fills no label color can rescue, which scanning cannot do because a per-node style line overrides the theme block; (3) HTML-looks-fine-but-prints-broken - checks for the print-color-adjust/page-break gotchas and returns the fix CSS; (4) arrows crossing objects - returns the ELK-renderer config + layout rules that minimize crossings. Pure deterministic - no AI, no rate limit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | No | contrast/readable: background/fill hex (#rrggbb). | |
| fg | No | contrast: foreground hex (#rrggbb). | |
| mode | No | Default "scan". scan=check rendered output; harden=fix a mermaid source before rendering; print=print-safety check; layout=arrow-crossing reduction. | |
| brand | No | brand palette to use (e.g. appstango). Default from config. | |
| large | No | contrast/harden: use the 3:1 large-text threshold. | |
| format | No | scan: content format (default svg). | |
| source | No | harden: the mermaid SOURCE text (not rendered SVG). | |
| autofix | No | scan: include suggested corrected colors. | |
| content | No | scan/print: the SVG or HTML diagram/document source. | |
| add_init | No | harden: prepend the %%{init}%% theme block (default true). | |
| renderer | No | layout: mermaid renderer (default "elk"). |