Check if an inputted string is in the right format for a valid rgb color
One thing the tests don't indicate is whether space is allowed before/after the color string. I'm inclined to be generous, so I'd suggest just discarding any space before you start:
color = color.strip()

Next, you are doing a lot of work to replace some python built-in functions. Before you do anything else, you should probably read the String Methods documentation to see what tools are available to you.
Try something like:
is_rgb = color.startswith('rgb(')
is_rgba = color.startswith('rgba(')

if not is_rgb and not is_rgba:
    return False

if not color.endswith(')'):
    return False

# strip off prefix &quot;...(&quot; and suffix &quot;)&quot;   
color = color[color.index('(') + 1:-1]

You can use .endswith to check for percent signs, also.