Color spaces

Many vector shapes in the druid/piet world are drawn with a solid color, and others are drawn with gradients which are defined in terms of colors. This raises the question: what’s the best way to specify colors?

The simplest approach is to use RGB colors. These are well understood, and even standardized in the form of the sRGB colorspace. However, it’s not ideal from a color communication perspective, because it’s hard to intuitively understand the relationship between the color and the numeric or hex code. For example, it’s extremely non-obvious when two colors have the same hue. When designing colorways for user interfaces, it’s often desirable to have highlight and accent colors drawn from the same hue, for example.

Another limitation of sRGB is that it covers a fairly limited gamut, and high-gamut (and HDR) displays are entering the mainstream. Fully supporting these HDR colors is beyond the scope of piet now, but we’d like a convention for representing color that will grow to support HDR in the future.

Thus, we’ve recently (in the form of piet#70) added a way to specify color using Hue, Luminance, and Chroma. It is based on the colorimetrically sound CIE Lab* standard (as opposed to RGB-derived color spaces such as HSV), but these quantities are intuitively clear, and it makes it especially easy to define a family of colors with the same hue. This color space is the same as used by freiefarbe.de.

Following freiefarbe.de, we chose the Lab*-based approach because of its simplicity and widespread existing adoption. Newer color spaces such as Jzazbz, IPT, and CAM16 (see references below) promise more perceptually accurate, particularly in hue constancy (where Lab* has errors particularly in the blue region). But they are also more complex and there is no consensus on which is best.

Resources

HDR

Last updated