def __delta(self, delta):
        tie = []
        if self.__rvar.get():
            red = self.__red + delta
            tie.append(red)
        else:
            red = self.__red
        if self.__gvar.get():
            green = self.__green + delta
            tie.append(green)
        else:
            green = self.__green
        if self.__bvar.get():
            blue = self.__blue + delta
            tie.append(blue)
        else:
            blue = self.__blue
        # now apply at boundary behavior
        atbound = self.__boundvar.get()
        if atbound == STOP:
            if red < 0 or green < 0 or blue < 0 or \
               red > 255 or green > 255 or blue > 255:
                # then
                red, green, blue = self.__red, self.__green, self.__blue
        elif atbound == WRAP or (atbound == RATIO and len(tie) < 2):
            if red < 0:
                red += 256
            if green < 0:
                green += 256
            if blue < 0:
                blue += 256
            if red > 255:
                red -= 256
            if green > 255:
                green -= 256
            if blue > 255:
                blue -= 256
        elif atbound == RATIO:
            # for when 2 or 3 colors are tied together
            dir = 0
            for c in tie:
                if c < 0:
                    dir = -1
                elif c > 255:
                    dir = 1
            if dir == -1:
                delta = max(tie)
                if self.__rvar.get():
                    red = red + 255 - delta
                if self.__gvar.get():
                    green = green + 255 - delta
                if self.__bvar.get():
                    blue = blue + 255 - delta
            elif dir == 1:
                delta = min(tie)
                if self.__rvar.get():
                    red = red - delta
                if self.__gvar.get():
                    green = green - delta
                if self.__bvar.get():
                    blue = blue - delta
        elif atbound == GRAV:
            if red < 0:
                red = 0
            if green < 0:
                green = 0
            if blue < 0:
                blue = 0
            if red > 255:
                red = 255
            if green > 255:
                green = 255
            if blue > 255:
                blue = 255
        self.__sb.update_views(red, green, blue)
        self.__root.update_idletasks()
dataset/ETHPy150Open francelabs/datafari/windows/python/Tools/pynche/DetailsViewer.py/DetailsViewer.__delta/original