Hex to HSL Converter
HSL restates a color in terms a person can reason about: what color it is, how vivid, and how light. That makes it the format to use when you want to change a color rather than just record it.
How the conversion works
Normalise the RGB channels to 0–1, then find the maximum and minimum of the three.
Lightness is the midpoint of those two. Saturation is their difference, divided by either their sum or by 2 minus their sum, depending on which side of 50% lightness you are on. Hue comes from which channel is the maximum, and by how much the other two differ.