def _parse(self, opt, fg, bg, attr):
    if not opt:
      return _Color(fg, bg, attr)

    v = self._config.GetString('%s.%s' % (self._section, opt))
    if v is None:
      return _Color(fg, bg, attr)

    v = v.strip().lower()
    if v == "reset":
      return RESET
    elif v == '':
      return _Color(fg, bg, attr)

    have_fg = False
    for a in v.split(' '):
      if is_color(a):
        if have_fg: bg = a
        else:       fg = a
      elif is_attr(a):
        attr = a

    return _Color(fg, bg, attr)
dataset/ETHPy150Open android/tools_repo/color.py/Coloring._parse/original