CONTRASTCRAFT
WCAG AUDITOR.
An offline-first accessibility contrast auditor, design token intelligence engine, and CSS remediation studio — computing exact W3C luminance, CSS cascade specificity, APCA Lc scores, N x N token matrices, and hue-preserving HSL patches with unified diff rollbacks.
FIXING ACCESSIBILITY WITHOUT DESTROYING BRAND COLOR IDENTITY.
Low-contrast text affects 81% of websites, yet naive fixers force everything to black or white. ContrastCraft resolves CSS variables accurately and adjusts HSL lightness while preserving brand hue.
Exact W3C & APCA Math
Linearizes sRGB channels for exact W3C contrast ratios alongside perceptual APCA Lc readability scores.
Cascade & Alpha Compositor
Parses HEX (3/4/6/8), RGB/RGBA, HSL/HSLA, 148 named colors, and CSS var(--tokens) with Porter-Duff alpha compositing.
N x N Token Compatibility Matrix
Evaluates every foreground x background design token pair and simulates cascade ripple impact before editing CSS.
Hue-Preserving HSL Fix Studio
Finds the minimal lightness delta needed to pass AA (4.5:1) or AAA (7.0:1) without shifting brand hues.
Safe Reversible Diff Patcher
Previews side-by-side split diffs and applies CSS edits with automatic .bak snapshots and 1-click revert.
7 Structural HTML A11y Checks
Audits missing alt text, unlabeled inputs, skipped heading hierarchy, ARIA role errors, and empty buttons/links.
HOW IT WORKS.
Browser Editorial SPA queries modular FastAPI HTML, CSS cascade, color/alpha, WCAG/APCA, token matrix, and patcher engines backed by SQLite.
DOM + CSS
Parse HTML tree, cascade & var(--tokens).
Alpha Blend
Porter-Duff composite semi-transparents.
WCAG / APCA
Exact luminance ratios & 7 HTML checks.
Token Matrix
N x N compatibility & cascade simulator.
HSL Patcher
Hue-safe lightness search + .bak revert.
APPLICATION SCREENSHOTS.
Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.
MATHEMATICAL CONTRAST & REMEDIATION VERIFICATION.
Key modules, rules, safety checks, and automated test results documented in the repository.
| Core Engine | Mathematical / Parsing Standard | Verified Output |
|---|---|---|
| Luminance & Ratio | W3C WCAG 2.1/2.2 sRGB linearization + APCA Lc | Exact 4.5:1 AA / 7.0:1 AAA classification |
| Color & Cascade | 148 named, Hex8, CSS4 slash RGBA/HSLA & var() | Porter-Duff alpha composited effective colors |
| Hue-Safe Search | HSL binary lightness adjustment preserving Hue | Maintains design identity on auto-fix |
| Patch Safety & Tests | .bak backups + revert API + SQLite session DB | 46 / 46 Pytest Passed (100%) |
CORE TECHNOLOGIES.
Frameworks, databases, visualization tools, and testing libraries used in ContrastCraft.
FUTURE ENHANCEMENTS.
Upcoming improvements planned for ContrastCraft.
EXPLORE SOURCE & DOCS.
View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.