Function hexToRgb

  • Converts a hex color code to RGB values.

    Parameters

    • hex: string

      The hex color code.

    Returns RGB

    An object with r, g, and b properties.

    If the input is not a valid hex color code.