13th pre-validation detector. Walks every text node, finds the closest ancestor with a usable solid fill (or first gradient stop as a coarse approximation), resolves both colors through doc.variables / theme, and computes WCAG 2.x relative-luminance contrast ratio. Flags ratios below 4.5:1 for normal text and 3.0:1 for large text (>=24px or >=19px bold). Detect-only severity (info). The 2026-05-09 review explicitly rejected auto-replacing fills via "nearest brand-token" heuristics — the right replacement depends on the design system + theme + intent, which only the user/agent can decide. Issues surface in the audit panel and chat status line so the misuse is visible without silently rewriting fills. Side effects: - Extracted parseHexColor / relativeLuminance / colorContrast from detectors.ts into diagnostics/color-utils.ts so the new detector doesn't duplicate ~30 lines of WCAG math. - New detector lives in diagnostics/detectors-typography.ts (mirroring the per-category split started by detectors-spacing.ts). - Adds @zseven-w/pen-core to pen-ai-skills deps so the detector can call resolveColorRef + getDefaultTheme — the canonical authority on the document's variable model. |
||
|---|---|---|
| .. | ||
| agent-native@22f20e42cd | ||
| pen-acp | ||
| pen-ai-skills | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||