How do I convert RGB to HSL?
Divide each RGB channel by 255, then find the maximum and minimum. Lightness is (max + min) ÷ 2, saturation comes from the difference between them, and hue depends on which channel is largest. rgb(37, 99, 235) becomes hsl(221, 83%, 53%).