code: def rgb_to_hexa(*args):
      
      if len(args) == 3:
          return ("#%2.2x%2.2x%2.2x" % tuple(args)).upper()
      elif len(args) == 4:
          return ("#%2.2x%2.2x%2.2x%2.2x" % tuple(args)).upper()
      else:
          raise ValueError("Wrong number of arguments.")
docs: Convert RGB(A) color to hexadecimal.