Repository navigation
First release of contrastkit. Install from source: see the README quick start.
Added
- Library (zero runtime dependencies, ESM + CommonJS + type declarations):
- Parsing of hex,
rgb()/rgba(),hsl()/hsla(),oklch()and the 148 CSS named
colors, with typed errors (ColorParseError,InvalidArgumentError); formatting to hex,
rgb(),hsl()andoklch(). - Conversions between sRGB, linear sRGB, OKLab, OKLCH and HSL, and CSS Color 4 gamut
mapping into sRGB. - WCAG 2.2 relative luminance, contrast ratio (with compositing of translucent
foregrounds) and checks for SC 1.4.3, 1.4.6 and 1.4.11. suggestFix: the closest passing foreground by OKLCH lightness, ranked by ΔE_OK.simulateCvd: protanopia, deuteranopia and tritanopia after Machado, Oliveira &
Fernandes (2009).auditPaletteandcheckRequirementsfor palette-wide audits.
- Parsing of hex,
- CLI
contrastkitwithcheck,fixandauditcommands,--jsonoutput and exit codes
for CI. - Palette Auditor web app (React + Vite), deployable to GitHub Pages.
- CI workflow (lint, format, typecheck, tests with coverage, builds on Node 20/22/24) and a
GitHub Pages deployment workflow.
Read more: Design notes · Palette Auditor · Foundations walkthrough