Parses an RGB or RGBA string and returns an object with the red, green, blue, and optionally alpha components.
The RGB or RGBA string to parse (e.g., "rgb(255, 255, 255)" or "rgba(255, 255, 255, 0.5)").
The RGB components or null if the input is invalid.
Parses an RGB or RGBA string and returns an object with the red, green, blue, and optionally alpha components.