Type-safe CSS colors for TypeScript
Loading 3D view...
oklch(0.623 0.188 259.823)Complementary
Triadic
Split Complementary
Analogous
Tetradic
Light to dark scale (like Tailwind)
| Step | White | Black | Best |
|---|---|---|---|
| 100 | 1.3 | 16.2 | B |
| 200 | 1.7 | 12.0 | B |
| 300 | 2.4 | 8.8 | B |
| 400 | 3.3 | 6.4 | B |
| 500 | 5.0 | 4.2 | W |
| 600 | 7.7 | 2.7 | W |
| 700 | 11.7 | 1.8 | W |
| 800 | 16.5 | 1.3 | W |
| 900 | 18.2 | 1.2 | W |
Protanopia
Red-blind (~1% of males)
Deuteranopia
Green-blind (~1% of males)
Tritanopia
Blue-blind (~0.003%)
Achromatopsia
Complete color blindness
Lc 61.3
Large Text
Lc 40.4
Large Headlines
APCA (Accessible Perceptual Contrast Algorithm)
Used in WCAG 3.0 draft
:root {
--color-primary: #3b82f6;
--color-primary-oklch: oklch(0.623 0.188 259.823);
--color-primary-rgb: rgb(59, 130, 246);
}#3b82f6rgb(59, 130, 246)hsl(217.22, 91%, 60%)oklch(0.623 0.188 259.823)color(display-p3 0.3047 0.5035 0.9338)import { color } from 'use-color';
const c = color('#3b82f6');
c.toHex(); // "#3b82f6"
c.toOklchString(); // "oklch(0.623 0.188 259.823)"
c.getLightness(); // 0.62
c.isDark(); // false
c.lighten(0.2); // Make lighter
c.saturate(0.2); // More vibrant
c.rotate(30); // Shift hue