def remove_color_widgets(self, widgets_to_remove=()):
        """Remove given color widgets (or the current one).

        Removal of widgets can only be done if the number
        to be remove won't leave the list of existing
        widgets empty, that is, there must always be at
        least one exiting color widget.

        Parameters
        ==========
        widgets_to_remove (iterable)
            contains references to the widgets to be removed;
            if empty, it is replaced by a list containing
            the current widget.
        """
        ### reference the existing color widgets locally
        ### for quicker and easier access
        widgets = self.widgets

        ### if the iterable with widgets to remove is empty,
        ### use a list with a reference to the current widget
        ### instead
        if not widgets_to_remove:
            widgets_to_remove = [self.current_widget]

        ### only advance if the removal of the widgets
        ### will leave at least one widget, otherwise you
        ### must leave the method early by returning
        if len(self.widgets) - len(widgets_to_remove) < 1:
            return

        ### since we didn't leave the method, then we assume
        ### it is ok to remove the given widgets, so we do
        ### so and performed extra tasks needed to keep
        ### the colors panel working suitably

        ## remove widgets
        for widget in widgets_to_remove:
            widgets.remove(widget)

        ### finally, perform setups needed when changing the
        ### number of existing widgets
        self.perform_widget_quantity_setups()
Remove given color widgets (or the current one).

        Removal of widgets can only be done if the number
        to be remove won't leave the list of existing
        widgets empty, that is, there must always be at
        least one exiting color widget.

        Parameters
        ==========
        widgets_to_remove (iterable)
            contains references to the widgets to be removed;
            if empty, it is replaced by a list containing
            the current widget.
        
nodezator/colorsman/editor/panel/colorsop.py