S = \begin{cases} 0 & \text{if } \Delta = 0 \\ \frac{\Delta}{1 - |2L - 1|} & \text{if } \Delta \neq 0 \end{cases}
H = \begin{cases} 0^\circ & \text{if } \Delta = 0 \\ 60^\circ \times \left( \frac{G' - B'}{\Delta} \mod 6 \right) & \text{if } C_{max} = R' \\ 60^\circ \times \left( \frac{B' - R'}{\Delta} + 2 \right) & \text{if } C_{max} = G' \\ 60^\circ \times \left( \frac{R' - G'}{\Delta} + 4 \right) & \text{if } C_{max} = B' \end{cases}
$R' = \text{toHex}(R)$ $G' = \text{toHex}(G)$ $B' = \text{toHex}(B)$ $\text{Hex} = \#R'G'B'$