HWB color model

From HandWiki

HWB (Hue, Whiteness, Blackness) is a cylindrical-coordinate representation of points in an RGB color model, similar to HSL and HSV. It was developed by HSV’s creator Alvy Ray Smith in 1996 to address some of the issues with HSV. HWB was designed to be more intuitive for humans to use[1] and slightly faster to compute. The first coordinate, H (Hue), is the same as the Hue coordinate in HSL and HSV. W and B stand for Whiteness and Blackness respectively and range from 0–100% (or 0–1). The mental model is that the user can pick a main hue and then “mix” it with white and/or black to produce the desired color.[2]

HWB was included in the CSS Level 4 Color Module in 2014.[1]

Conversion

HWB is very closely related to HSV, and therefore the conversion formulas are fairly simple.[2] Before conversion from HWB, if the sum of whiteness and blackness exceeds 100%, both components must be scaled back proportionally to make the sum 100%.

HSV to HWB HWB to HSV RGB to HWB
[math]\displaystyle{ \begin{align} H &= H\\ W &= (1-S)V\\ B &= 1 - V \end{align} }[/math] [math]\displaystyle{ \begin{align} H &= H\\ S &= 1 - \frac{W}{1-B} \\ V &= 1 - B \end{align} }[/math] [math]\displaystyle{ \begin{align} H &= \ldots\\ W &= \min(R, G, B)\\ B &= 1 - \max(R, G, B) \end{align} }[/math]

Swatches

The CSS Color Level 4 draft specification [1] includes a number of HWB example color swatches.[3]


References

  1. 1.0 1.1 1.2 "§7 HWB Colors: hwb() function". CSS Color Module Level 4. W3C. 15 April 2014. https://www.w3.org/TR/css-color-4/#the-hwb-notation. 
  2. 2.0 2.1 Smith, Alvy Ray (1996). "HWB — A More Intuitive Hue-Based Color Model". Journal of Graphics, GPU and Game tools 1 (1): 3–17. http://alvyray.com/Papers/CG/HWB_JGTv208.pdf.  This is the original paper describing the HWB color model.
  3. CSS Color Module Level 4