docs: def color_to_rgba(color, alpha_float=True):
      """\
      Returns a (R, G, B, A) tuple.
  
      :param color: A web color name (i.e. ``darkblue``) or a hexadecimal value
              (``#RGB`` or ``#RRGGBB``) or a RGB(A) tuple (i.e. ``(R, G, B)`` or
              ``(R, G, B, A)``)
      :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: ``(R, G, B, A)`` tuple.
      """
      res = []
      alpha_channel = (1.0,) if alpha_float else (255,)
      if isinstance(color, tuple):
          col_length = len(color)
          is_valid = False
          if 3 <= col_length <= 4:
              for i, part in enumerate(color[:3]):
                  is_valid = 0 <= part <= 255
                  res.append(part)
                  if not is_valid or i == 2:
                      break
              if is_valid:
                  if col_length == 4:
                      res.append(_alpha_value(color[3], alpha_float))
                  else:
                      res.append(alpha_channel[0])
          if is_valid:
              return tuple(res)
          raise ValueError('Unsupported color "{0}"'.format(color))
      try:
          return _NAME2RGB[color.lower()] + alpha_channel
      except KeyError:
          try:
              clr = _hex_to_rgb_or_rgba(color, alpha_float=alpha_float)
              if len(clr) == 4:
                  return clr
              else:
                  return clr + alpha_channel
          except ValueError:
              raise ValueError('Unsupported color "{0}". Neither a known web '
                               'color name nor a color in hexadecimal format.'
                               .format(color))