<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_spectrum(self, label, spectrum, color=None):
 """ Adds a Spectrum for plotting. Args: label (str):
 Label for the Spectrum. Must be unique. spectrum: Spectrum object color (str):
 This is passed on to matplotlib. E.g., "k--" indicates a dashed black line. If None, a color will be chosen based on the default color cycle. """

        self._spectra[label] = spectrum
        self.colors.append(
            color or
            self.colors_cycle[len(self._spectra) % len(self.colors_cycle)])