def color_list_on_mouse_release(self, event):
        """Trigger exiting colors viewer or invoke button.

        Parameters
        ==========
        event (pygame.event.Event instance)
            event of type MOUSEBUTTONUP; its 'pos' attribute
            contains a tuple with two integers and represents
            the position of the mouse on the screen;

            check the glossary entry for the "mouse action
            protocol".
        """
        ### retrieve the position of the mouse
        mouse_pos = event.pos

        ### if the mouse is out of the area occupied by
        ### the color viewer, trigger exiting the color
        ### viewer by turning the 'running' flag off and
        ### exiting the method by returning

        if not self.rect.collidepoint(event.pos):
            self.running = False
            return

        ### if we don't return in the previous block, we
        ### look for the first button which collides with
        ### the mouse

        for button in self.buttons:

            ## if a button collides, execute its mouse
            ## release action if it has one, then break out
            ## of the "for loop"

            if button.rect.collidepoint(mouse_pos):

                try:
                    method = getattr(button, "on_mouse_release")

                except AttributeError:
                    pass

                else:
                    method(event)

                break
Trigger exiting colors viewer or invoke button.

        Parameters
        ==========
        event (pygame.event.Event instance)
            event of type MOUSEBUTTONUP; its 'pos' attribute
            contains a tuple with two integers and represents
            the position of the mouse on the screen;

            check the glossary entry for the "mouse action
            protocol".
        
nodezator/colorsman/viewer/modes/colorlist.py