code: def rgb_tuple_from_str(color_string):
      
      try:
          # English color names (limited)
          rgb_string = common_html_colors[color_string]
          return tuple([float(x) for x in re.findall(r'\d{1,3}', rgb_string)]) 
      
      except KeyError:
          try:
              # HEX color code
              hex_string = color_string.lstrip('#')
              return tuple(int(hex_string[i:i+2], 16) for i in (0, 2 ,4))
          
          except ValueError:
              # RGB or RGBA formatted strings
              return tuple([int(x) if float(x) > 1 else float(x) 
                            for x in re.findall(r"[-+]?\d*\.*\d+", color_string)])
docs: Convert color in format 'rgb(RRR,GGG,BBB)', 'rgba(RRR,GGG,BBB,alpha)',  
      '#RRGGBB', or limited English color name (eg 'red') to tuple (RRR, GGG, BBB)