class_docstr: QSpectrumAnalyzer colors dialog
docstr: Save settings when dialog is accepted
docstr_tok: ["Save","settings","when","dialog","is","accepted"]
code: def accept(self):
      """Save settings when dialog is accepted"""
      settings = QtCore.QSettings()
      settings.setValue(
          "main_color", color_to_str(self.mainColorButton.color())
      )
      settings.setValue(
          "peak_hold_max_color",
          color_to_str(self.peakHoldMaxColorButton.color()),
      )
      settings.setValue(
          "peak_hold_min_color",
          color_to_str(self.peakHoldMinColorButton.color()),
      )
      settings.setValue(
          "average_color", color_to_str(self.averageColorButton.color())
      )
      settings.setValue(
          "persistence_color",
          color_to_str(self.persistenceColorButton.color()),
      )
      settings.setValue(
          "baseline_color",
          color_to_str(self.baselineColorButton.color()),
      )
      QtWidgets.QDialog.accept(self)
  
file_path: qspectrumanalyzer/qspectrumanalyzer/colors.py
imports: from Qt import QtCore, QtWidgets
  from qspectrumanalyzer.utils import color_to_str, str_to_color
  from qspectrumanalyzer.ui_qspectrumanalyzer_colors import Ui_QSpectrumAnalyzerColors
label_desc: Use image node_id 2 for calling the QSpectrumAnalyzerColors obj's underlying member method code with example usage: obj.accept() without return types