Colour Codes in Practice: Converting Between HEX, RGB and HSL, and Computing WCAG Contrast
HEX, RGB and HSL are three coordinate systems for the same colour. Beyond the conversion formulas, the practical question is which to choose: HSL is far more predictable for adjusting colours, and greyscale calculation is essential for palettes. This guide gives the formulas, why HSL suits adjustment, and how to compute and judge WCAG contrast.