code: def create_new_scheme(self):
          
          names = self.get_option('names')
          custom_names = self.get_option('custom_names', [])
  
          # Get the available number this new color scheme
          counter = len(custom_names) - 1
          custom_index = [int(n.split('-')[-1]) for n in custom_names]
          for i in range(len(custom_names)):
              if custom_index[i] != i:
                  counter = i - 1
                  break
          custom_name = "custom-{0}".format(counter+1)
  
          # Add the config settings, based on the current one.
          custom_names.append(custom_name)
          self.set_option('custom_names', custom_names)
          for key in syntaxhighlighters.COLOR_SCHEME_KEYS:
              name = "{0}/{1}".format(custom_name, key)
              default_name = "{0}/{1}".format(self.current_scheme, key)
              option = self.get_option(default_name)
              self.set_option(name, option)
          self.set_option('{0}/name'.format(custom_name), custom_name)
  
          # Now they need to be loaded! how to make a partial load_from_conf?
          dlg = self.scheme_editor_dialog
          dlg.add_color_scheme_stack(custom_name, custom=True)
          dlg.set_scheme(custom_name)
          self.load_from_conf()
  
          if dlg.exec_():
              # This is needed to have the custom name updated on the combobox
              name = dlg.get_scheme_name()
              self.set_option('{0}/name'.format(custom_name), name)
  
              # The +1 is needed because of the separator in the combobox
              index = (names + custom_names).index(custom_name) + 1
              self.update_combobox()
              self.schemes_combobox.setCurrentIndex(index)
          else:
              # Delete the config ....
              custom_names.remove(custom_name)
              self.set_option('custom_names', custom_names)
              dlg.delete_color_scheme_stack(custom_name)
docs: Creates a new color scheme with a custom name.