PROJECT 30 • DAY 10 OF 90 • ACCESSIBILITY DEVTOOLS

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.

Python 3.10+FastAPI 0.162WCAG 2.2 AA/AAAAPCA LcPorter-Duff Alpha46/46 Pytest
ContrastCraft Preview
COMPLIANCE ENGINE
WCAG 2.2 + APCA Lc
PYTEST SUITE
46 / 46 Passed
6 Workspaces
Editorial Audit Studio
N x N Matrix
Design Token Cascade Sim
7 Checks
Structural HTML A11y Audit
46 / 46
Pytest Tests Passed
01 / Overview

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.

01

Exact W3C & APCA Math

Linearizes sRGB channels for exact W3C contrast ratios alongside perceptual APCA Lc readability scores.

02

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.

03

N x N Token Compatibility Matrix

Evaluates every foreground x background design token pair and simulates cascade ripple impact before editing CSS.

04

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.

05

Safe Reversible Diff Patcher

Previews side-by-side split diffs and applies CSS edits with automatic .bak snapshots and 1-click revert.

06

7 Structural HTML A11y Checks

Audits missing alt text, unlabeled inputs, skipped heading hierarchy, ARIA role errors, and empty buttons/links.

02 / Architecture

HOW IT WORKS.

Browser Editorial SPA queries modular FastAPI HTML, CSS cascade, color/alpha, WCAG/APCA, token matrix, and patcher engines backed by SQLite.

STAGE 01

DOM + CSS

Parse HTML tree, cascade & var(--tokens).

→
STAGE 02

Alpha Blend

Porter-Duff composite semi-transparents.

→
STAGE 03

WCAG / APCA

Exact luminance ratios & 7 HTML checks.

→
STAGE 04

Token Matrix

N x N compatibility & cascade simulator.

→
STAGE 05

HSL Patcher

Hue-safe lightness search + .bak revert.

03 / Screenshots

APPLICATION SCREENSHOTS.

Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.

04 / Technical Details

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%)
05 / Tech Stack

CORE TECHNOLOGIES.

Frameworks, databases, visualization tools, and testing libraries used in ContrastCraft.

BACKEND API
FastAPI 0.162 • Python 3.10+
FRONTEND UI
Vanilla ES Modules • Editorial UI
STANDARDS
W3C WCAG 2.1/2.2 • APCA Lc
TOKEN ENGINE
CSS Cascade & N x N Matrix
PERSISTENCE
SQLite 3 Session Store + .bak Diffs
VERIFICATION
Pytest (46/46 Passed)
06 / Next Steps

FUTURE ENHANCEMENTS.

Upcoming improvements planned for ContrastCraft.

Playwright headless computed-style DOM scraper for live deployed URLs.
OKLCH perceptual uniformity search mode alongside HSL.
VS Code extension inline contrast squiggles and quick-fix actions.
CI GitHub Action failing PRs on token matrix regression.
Color-blindness (Deuteranopia/Protanopia/Tritanopia) palette simulator.
Figma Variables JSON two-way design token sync.
OPEN-SOURCE PROJECT • GITHUB.COM/RAGURAMRRP

EXPLORE SOURCE & DOCS.

View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.