RGB to HSL Converter
The same conversion as hex to HSL, starting from decimal channel values instead. Use it when your source is an rgb() string, a design tool readout or an image sample.
How the conversion works
Divide each channel by 255, then take the maximum and minimum. Lightness is their average; saturation is their spread relative to how close lightness is to the middle; hue is determined by which channel leads.