Function rgbToHsv

  • Converts RGB values to HSV values.

    Parameters

    • rgb: RGB

      An object with r, g, and b properties.

    Returns HSV

    An object with h, s, and v properties.

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