Function rgbToHsl

  • Converts RGB values to HSL values.

    Parameters

    • rgb: RGB

      An object with r, g, and b properties.

    Returns HSL

    An object with h, s, and l properties.

    If the input is not a valid RGB object or if RGB values are out of range.