Skip to main content
RETURN TO SELECTED WORK
CASE STUDY // 03Design Systems & Accessibility

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.

ROLE
Design Systems & Frontend Engineer
TIMELINE
2026
SCOPE
Interactive Web Demo
ACCENT
#f59e0b
Interactive Browser DemoCLIENT SANDBOX
215°
50AAA
#EDF3FD
16.94:1 WCAG
Lc 97.9
100AAA
#C9DDF7
13.64:1 WCAG
Lc 84.3
300AA
#679BE4
6.64:1 WCAG
Lc 49
500AA
#1F6BD6
5.08:1 WCAG
Lc 79.9
700AAA
#0F428A
9.69:1 WCAG
Lc 96.2
900AAA
#051F42
16.39:1 WCAG
Lc 105.6
WCAG 2.2 + APCA CONTRAST CHECK (900 ON 50)14.71:1 • Lc 95.6 (PASS AA/AAA)
Aa — Deterministic contrast check at hue 215° (14.71:1 WCAG 2.2)
CONFIGURATION & SCOPE

Demo Parameters & Baseline

WCAG 2.2 AA/AAA
Standard
APCA Lc
Perceptual Model
6 Scales
Palette Steps
Live sRGB
Computation
QUALITY & VERIFICATION

Invariants & Edge Cases Checked

vitest run tests/chroma-contrast.test.ts
Contrast ratios and APCA Lc scores are computed live in-browser from the actual rendered RGB values of each hue step.

System Invariants

WCAG 2.2 contrast ratio obeys symmetric relative-luminance formula (L1 + 0.05) / (L2 + 0.05) across all 360° hues.
Foreground text polarity flips dynamically when hue luminance shifts (e.g. yellow 60° vs indigo 240°).
Exported CSS custom properties match the currently selected hue and step scale.

Edge Cases Covered

High-luminance hues (yellow/cyan 50°–180°) trigger accurate pass/fail badges instead of hardcoded AAA claims.
Clipboard export handles repeat clicks cleanly without stale copied state.
Vision-deficiency toggles isolate visual CSS filters without altering exported token values.
THE CHALLENGE

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.

THE ARCHITECTURE

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.

ENGINEERING TRADEOFFS

Critical Technical Decisions

DECISION 01

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.

DECISION 02

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.

DECISION 03

Property-Based Verification Fit

Colour-space and luminance conversions are ideal targets for property-based invariants (symmetry, monotonicity, bounded range).

IMPLEMENTATION DETAILS

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.

IMPLEMENTED TECHNOLOGIES

Technology Stack

TypeScriptWCAG 2.2 ContrastAPCA LcCSS TokensReact 19

Explore Source Code & QA Playbook

Inspect repositories on GitHub or review my QA automation and test design approach.