Skip to content

v3.0.0

Choose a tag to compare

@basiclines basiclines released this 09 Mar 09:37
· 14 commits to main since this release

🚀 v3.0.0 — Built-in APCA & OKLCH, zero license baggage

Breaking Changes

  • APCA is now the default contrast mode — contrast() returns APCA Lc scores by default. Use .mode('wcag') for WCAG 2.x ratios.
  • Removed registerApca() and isApcaAvailable() — APCA is always built-in, no optional dependency needed.
  • Removed apca-w3 and culori dependencies — replaced with clean-room implementations from public specifications.

New

  • src/engine/ApcaEngine.ts — Clean-room APCA 0.98G-4g implementation from the W3C Silver Wiki spec. Bit-identical output to apca-w3, 1.5× faster.
  • src/engine/OklchMathEngine.ts — Clean-room OKLCH ↔ sRGB conversions from Björn Ottosson's OKLab paper + CSS Color Level 4. Identical hex roundtrips, 1.26× faster on Hex→OKLCH.

Migration

- import { contrast, registerApca, isApcaAvailable } from '@basiclines/rampa-sdk';
+ import { contrast } from '@basiclines/rampa-sdk';

- // Before: WCAG was default
- contrast('#fff', '#000');                  // WCAG ratio
- contrast('#fff', '#000').mode('apca');       // APCA Lc

+ // After: APCA is default
+ contrast('#fff', '#000');                  // APCA Lc
+ contrast('#fff', '#000').mode('wcag');       // WCAG ratio

No changes needed for color spaces, palettes, mixing, or any other SDK features.