code: def _convert_tuple_color_to_hex(cls, color):
          
          if isinstance(color, tuple):
              return '#{:02x}{:02x}{:02x}'.format(*color)
          elif isinstance(color, str):
              if not color.startswith('#'):
                  return '#{color_hex}'.format(color_hex=color)
              else:
                  return color
          else:
              return '#000'
docs: Convert tuple of color element (r, g, b) to hexa.
  
          :param color: A color tuple
          :type color: (int, int, int) | str
  
          :return: Hexa representation of the color
          :rtype: str