Perceptual hue, physical tone
Hue is the polar angle of OKLab, so blue stays blue in the deep region where CAM16 twists violet. Tone is CIE 1931 Y, so luminance is a measurable quantity instead of an opinion.
OKYCT is a zero-dependency perceptual color engine built for emissive displays. OKLab hue, CIE-anchored tone, and accessibility guaranteed by algebra — not by guesswork.
MIT licensed · TypeScript · zero runtime dependencies
Hue is the polar angle of OKLab, so blue stays blue in the deep region where CAM16 twists violet. Tone is CIE 1931 Y, so luminance is a measurable quantity instead of an opinion.
Because Y is strictly monotonic in OKLab L, one analytic derivative converges in 5–7 iterations. No nested CAM16 bisection and no transcendental search.
Out-of-gamut colors fold back along a constant-hue ray toward the cusp. ΔH is zero by construction, so vivid reds never drift to orange.
Tone and Y are bijective, so WCAG 2.1 and APCA thresholds invert in closed form. Accessibility becomes an O(1) constraint rather than an audit sweep.
Every number below is measured live in your browser by @sandlada/benchmark — OKYCT, Google MCU, and culori on a shared protocol v2 seed.
Measured live from seed · #1A73E8
| Benchmark | Setup | OKYCTCIE L* + okyctToRgb | Google MCUHCT tone solve | culoriOKLCH L* solve |
|---|---|---|---|---|
Tone accuracyWorst ΔL* vs shared targets
| T10–T95 tonal scale | p95 Δ0.14 | p95 Δ0.19 | p95 Δ0.24 |
Mean hue driftAverage over 10 stops
| T10–T95 tonal scale | 0.08° w | 1.51° w | 0.12° w |
Max hue driftp95 weighted OKLab drift
| T10–T95 tonal scale | p95 0.24° | p95 3.37° | p95 0.24° |
Semantic role AALight/dark MD3 role pairs (11 each)
| T10–T95 tonal scale | L 11/11 · D 11/11 | L 11/11 · D 11/11 | L 11/11 · D 11/11 |
Solve timePer 10-stop scale
| T10–T95 tonal scale | 0.11 ms | 0.48 ms | 0.79 ms |
Borrowed color-appearance models were designed for reflected light. OKYCT starts from the physics of a pixel: an OKLab polar plane for hue, CIE 1931 Y for tone, and a strictly monotonic Newton solver in between. The result is a color system that stays honest on OLED, survives gamut clipping with zero hue drift, and proves its contrast instead of sampling for it.
OLED, AMOLED and MicroOLED behave differently in the dark. OKYCT ships hardware profiles instead of one universal "dark mode".
Pixels switch off completely for maximum static contrast and the lowest idle power draw.
A sub-threshold bias keeps the organic layer awake, cutting step response from 18.5 ms to 1.6 ms at 120 Hz.
Lifted blacks and a soft highlight ceiling remove pancake-lens halation in near-eye displays.
P = 1.05·Rγ + 0.85·Gγ + 2.40·Bγ. Blue is the most expensive channel and the fastest to age, so hazardous hues are capped and nudged toward cyan.
The engine is running in your browser right now. Change the seed and the particles, the palette rows and the token roles all follow the same perceptual pipeline.
A ramp is a tone. A token is the job that tone is hired to do. OKYCT keeps a small set of roles: primary, surface, and status. Change the seed above and those jobs stay the same.
OKYCT is MIT licensed, dependency-free, and available for TypeScript today — with Dart and Rust implementations on the way.