Chroma Engine
Live colour scale generator with real WCAG 2.2 AA/AAA contrast ratios and APCA perceptual checks.
A design-system contrast and token inspection tool. Computes live relative-luminance WCAG 2.2 contrast ratios and APCA Lc estimates across 6 surface/ink steps, with colour-vision deficiency previews and one-click CSS variable export.
Demo Parameters & Baseline
Invariants & Edge Cases Checked
vitest run tests/chroma-contrast.test.tsSystem Invariants
Edge Cases Covered
Problem Statement
Standard HSL sliders treat yellow and blue identically in mathematical lightness even though human luminance perception differs sharply, silently failing WCAG 2.2 readability checks.
Design Solution
Implemented real-time sRGB relative luminance and APCA Lc computation directly inside the interactive swatch matrix, exposing honest pass/fail transitions across every hue angle.
Critical Technical Decisions
WCAG 2.2 AA/AAA as Primary Compliance Baseline
WCAG 2.2 AA is the established compliance standard teams audit against; APCA Lc is shown alongside it as complementary perceptual telemetry.
Live Calculated Scores Over Static Swatch Labels
Computing contrast dynamically per hue ensures yellow and green ramps accurately report contrast drops instead of displaying hardcoded passes.
Property-Based Verification Fit
Colour-space and luminance conversions are ideal targets for property-based invariants (symmetry, monotonicity, bounded range).
Capabilities & Behaviour
Live hue sweep across 0°–360° with real-time HSL-to-sRGB relative luminance calculation.
Honest WCAG 2.2 AA (4.5:1) and AAA (7.0:1) ratio calculation plus APCA Lc perceptual score per step.
Interactive colour-vision deficiency preview filters (Normal, Protanopia, Deuteranopia).
Automatic foreground contrast polarity selection so badge text stays legible across bright yellows and deep blues.
One-click export to CSS Custom Properties with clipboard confirmation state.
Technology Stack
Explore Source Code & QA Playbook
Inspect repositories on GitHub or review my QA automation and test design approach.