def set(self, value, custom_command=True):
        """Set the value of the widget.

        Parameters
        ==========
        value (string or tuple)
            check __init__ docstring for more info on this
            parameters; the format must be compatible with
            the settings stored in the 'color_format' and
            'alone_when_single' attributes; again, look into
            the __init__ docstring for the parameters with
            the same name as those attributes for more
            info.
        custom_command (boolean)
            indicates whether the custom command stored
            upon instantiation should be executed after
            updating the value.
        """
        ### check whether value and its type are valid

        try:
            validate_custom_color_format(
                value, self.color_format, self.alone_when_single
            )

        ### if not, report error and exit the method by
        ### returning earlier

        except (ValueError, TypeError) as err:

            print(err)
            return

        ### changes are only performed if the new value is
        ### indeed different from the current one

        if self.value != value:

            ### store new value
            self.value = value

            ### update the widget image
            self.update_image()

            ### if requested, execute the custom command
            if custom_command:
                self.command()
Set the value of the widget.

        Parameters
        ==========
        value (string or tuple)
            check __init__ docstring for more info on this
            parameters; the format must be compatible with
            the settings stored in the 'color_format' and
            'alone_when_single' attributes; again, look into
            the __init__ docstring for the parameters with
            the same name as those attributes for more
            info.
        custom_command (boolean)
            indicates whether the custom command stored
            upon instantiation should be executed after
            updating the value.
        
nodezator/widget/colorbutton.py