Function isValidRgb

  • Checks if the provided string is a valid RGB color format.

    Parameters

    • rgb: string

      The string to validate as RGB (e.g., "rgb(255, 0, 128)").

    Returns boolean

    True if the string is a valid RGB format, false otherwise.