HWB to Lab Converter

Converted Lab Output --
100%

Wide-Gamut & Linear Formats

Modern CSS color space notations derived from this color

Contrast Analysis (WCAG 2.1)

Checks the converted color against foreground or background targets for accessibility compliance.

How to Convert HWB to CIELAB (Lab)

Converting HWB to CIELAB (Lab) moves a color from a device-dependent model into a perceptually uniform space based on human vision.

The Limitations of HWB

HWB is intuitive for mixing colors, but it is still bound by the limitations of the sRGB color space. In HWB, adding 20% white to a pure blue and 20% white to a pure yellow will yield two colors that have the same mathematical "Whiteness." However, to the human eye, the yellow will appear significantly brighter than the blue. HWB does not account for how our eyes perceive different wavelengths of light.

The CIELAB Solution

CIELAB (Lab) was designed to map color exactly as humans see it. The L channel represents absolute Lightness. If two colors share a Lab lightness of 60%, they will look equally bright to an observer, regardless of their hue. The a and b channels handle the color data along green-red and blue-yellow opponent axes.

The Conversion Pipeline

Because HWB is just a cylindrical wrapper around RGB, converting it to Lab requires a multi-step mathematical pipeline:

  1. Convert HWB to standard RGB.
  2. Remove the gamma correction curve to get Linear RGB.
  3. Convert Linear RGB to the CIE XYZ reference space using matrix multiplication.
  4. Transform XYZ into the perceptual Lab axes using a non-linear cube-root function.

Related Tools