code: def hexa_to_rgb(color):
      
      r = int(color[1:3], 16)
      g = int(color[3:5], 16)
      b = int(color[5:7], 16)
      if len(color) == 7:
          return r, g, b
      elif len(color) == 9:
          return r, g, b, int(color[7:9], 16)
      else:
          raise ValueError("Invalid hexadecimal notation.")
docs: Convert hexadecimal color to RGB.