code: def check_theme(theme):
          
          terminal_colors = curses.COLORS if curses.has_colors() else 0
  
          if theme.required_colors > terminal_colors:
              return False
          elif theme.required_color_pairs > curses.COLOR_PAIRS:
              return False
          else:
              return True
docs: Check if the given theme is compatible with the terminal