def color_widget_to_visible_area(self):
        """Move widgets so current one is in visible area.

        The visible area is the scroll area, since all
        the widgets inside the scroll area (and not just
        touching it) are completely visible.

        We perform the movement if the current widget isn't
        already inside the visible area.
        """
        ### reference the rect of the current widget locally
        widget_rect = self.current_widget.rect

        ### obtain a copy of the current widget's rect
        ### clamped to the scroll area
        clamped_copy = widget_rect.clamp(self.scroll_area)

        ### if the original and clamped rects are the same,
        ### it means the current widget is already in the
        ### visible area, so we can return already
        if clamped_copy == widget_rect:
            return

        ### otherwise we obtain the difference between the
        ### positions of the clamped and original rects
        ### move all the widgets by that difference, so that
        ### the current widget ends up in the visible area

        offset = [a - b for a, b in zip(clamped_copy.topleft, widget_rect.topleft)]

        self.widgets.rect.move_ip(offset)
Move widgets so current one is in visible area.

        The visible area is the scroll area, since all
        the widgets inside the scroll area (and not just
        touching it) are completely visible.

        We perform the movement if the current widget isn't
        already inside the visible area.
        
nodezator/colorsman/editor/panel/colorsop.py