OKLCH & P3 CSS Color Space Generator

Convert legacy HEX codes into modern, high-gamut OKLCH values to unlock ultra-vibrant, mathematically uniform UI color palettes.

Color Controls


Perceived brightness (0% Black - 100% White).
Amount of color/saturation. High values may require P3 displays.
Position on the color wheel (0-360 degrees).
Standard sRGB
#10b981
Vs White WCAG 2
-- Wait
APCA (Lc) --
Vs Black WCAG 2
-- Wait
APCA (Lc) --
Modern OKLCH
oklch(...)
Legacy RGB
rgb(...)
Uniformity Matrix (100-900)
Generated purely by shifting the L (Lightness) channel.
These harmonies are calculated purely via Hue rotation. Because OKLCH is mathematically uniform, they share the exact same perceived brightness.

Complementary (Hue + 180°)

Analogous (Hue ± 30°)

Triadic (Hue + 120°, Hue + 240°)

Color Vision Deficiency (CVD) Simulation. See how your color appears to users with different types of color blindness.
Protanopia Red-Blind
~1% of males. Affects L-cones (red).
Deuteranopia Green-Blind
~1% of males. Affects M-cones (green).
Tritanopia Blue-Blind
Very rare. Affects S-cones (blue).
Achromatopsia Monochromacy
Extremely rare. No color vision.

Why HSL is Dead (The OKLCH Advantage)

For over a decade, frontend developers used hsl() (Hue, Saturation, Lightness) to generate color palettes. However, HSL is mathematically flawed regarding human perception. In HSL, a "yellow" at 50% lightness looks vastly brighter to the human eye than a "blue" at 50% lightness. If you change the Hue, the perceived brightness shifts wildly.

OKLCH fixes this entirely.

In OKLCH, the L (Lightness) channel represents true perceived human brightness. If you lock L to 60%, you can rotate the H (Hue) across the entire 360-degree color wheel, and every single color will appear to have the exact same luminous intensity. This allows designers to programmatically generate ultra-uniform 100-900 UI palettes (like our [Tailwind Config] generator does) without manually tweaking every single shade by eye.

WCAG 2 vs APCA (WCAG 3.0)

Standard WCAG 2 contrast ratios (e.g., 4.5:1) are fundamentally broken on modern displays, especially in dark mode. They often fail readable text and pass unreadable text. The accessibility industry is moving to APCA (Accessible Perceptual Contrast Algorithm) for WCAG 3.0.

APCA calculates a Lightness Contrast (Lc) score instead of a ratio. An Lc score of ~75 is roughly equivalent to a WCAG 2 AA rating, while an Lc score of ~90 is equivalent to AAA. Our engine calculates both WCAG 2 ratios and APCA Lc scores in real-time, allowing you to future-proof your UI components.

Designing for Color Blindness (CVD)

Color Vision Deficiency (CVD) affects roughly 8% of men globally. A perfectly uniform OKLCH palette is useless if it relies entirely on Hue to distinguish UI elements (like a red "Error" button and a green "Success" button).

By using our [CVD Sim] tab, you can instantly see how your color translates to users with Protanopia (red-blind) or Deuteranopia (green-blind). To ensure accessibility, never rely on Hue alone; always ensure sufficient Lightness (L) variation between critical UI elements.

What is Display P3 and High Gamut?

Legacy formats like HEX and RGB are locked into the sRGB color space, which was defined in 1996 for old CRT monitors. Modern Apple displays, OLED TVs, and flagship phones use the Display P3 color space, which contains roughly 25% more vibrant colors—especially deep reds, ultra-bright greens, and vivid oranges.

If you use HEX or standard RGB, you are literally cutting off the top 25% of vibrant colors that your users' screens can actually display. oklch() is an unbounded color space. By simply pushing the Chroma (C) value higher in our generator, you can access these hyper-vibrant P3 colors natively in CSS. Our engine features a "Gamut Badge" to alert you when your color exceeds standard sRGB capabilities.

OKLCH vs OKLAB

You may see oklab() mentioned alongside oklch(). They represent the exact same color space, just mapped differently.

  • OKLAB uses Cartesian coordinates (a, b axes) for color. It's excellent for programmatic color mixing and CSS gradients.
  • OKLCH uses Cylindrical coordinates (Chroma, Hue angle). It is far more intuitive for human designers to understand (e.g., "increase the saturation" = "increase C").

Frequently Asked Questions

Color Theory

Why should I use OKLCH instead of HSL or RGB?
OKLCH provides perceptually uniform lightness, meaning colors with the same lightness value will appear equally bright to the human eye. This makes creating harmonious color palettes and accessible contrast ratios much more reliable than HSL or RGB.

Color Spaces

What is the P3 color space?
Display P3 is a wide-gamut color space that offers a broader range of vibrant colors compared to standard sRGB, particularly in greens and reds. It is supported by most modern displays and browsers.

Browser Support

Does this generator provide fallback colors for older browsers?
Yes, the tool generates CSS that utilizes the `color()` function and modern formats like OKLCH, while providing fallback sRGB values ensuring cross-browser compatibility for older environments.

Rate OKLCH & P3 CSS Color Space Generator

Help us improve by rating this tool.

4.7/5
242 reviews