docs: def _hex_to_rgb_or_rgba(color, alpha_float=True):
      """\
      Helper function to convert a color provided in hexadecimal format (``#RGB``
      or ``#RRGGBB``) to a RGB(A) tuple.
  
      :param str color: Hexadecimal color name.
      :param bool alpha_float: Indicates if the alpha value should be returned as
              float value. If ``False``, the alpha value is an integer value in
              the range of ``0 .. 254``.
      :return: Tuple of integer values representing a RGB(A) color.
      :rtype: tuple
      :raises: :py:exc:`ValueError` in case the provided string could not
                  converted into a RGB(A) tuple
      """
      if color[0] == '#':
          color = color[1:]
      if 2 < len(color) < 5:
          # Expand RGB -> RRGGBB and RGBA -> RRGGBBAA
          color = ''.join([color[i] * 2 for i in range(len(color))])
      color_len = len(color)
      if color_len not in (6, 8):
          raise ValueError('Input #{0} is not in #RRGGBB nor in #RRGGBBAA format'.format(color))
      res = tuple([int(color[i:i+2], 16) for i in range(0, color_len, 2)])
      if alpha_float and color_len == 8:
          res = res[:3] + (_alpha_value(res[3], alpha_float),)
      return res