Skip to main content

HSV and HSL

Hue, Saturation, Value ⇄ Hue, Saturation, Lightness

HSV to HSL

L=V1S2S={0 if L=0 or L=1VLmin(L,1L) otherwise \begin{align*} L &= V \cdot \frac{1 - S}{2} \:\\ S &= \begin{cases} 0 & \text{ if } L = 0 \text{ or } L = 1 \\ \frac{V-L}{min(L,1-L)} & \text{ otherwise } \end{cases} \\ \end{align*}

HSL to HSV

V=LSmin(L,1L)S={0 if V=02(1LV) otherwise \begin{align*} V &= L \cdot S \cdot min(L, 1-L) \\ \:\\ S &= \begin{cases} 0 & \text{ if } V=0 \\ 2 \cdot (1 - \frac{L}{V}) & \text{ otherwise } \end{cases} \\ \end{align*}