

def getdisplayedcolors(self, x, y):
    'Returns the fg and bg colors of the given cell as pygame.Color objects, modified for the tint. If x and y is not on the surface, returns (None, None)'
    if ((x < 0) or (y < 0) or (x >= self._width) or (y >= self._height)):
        return (None, None)
    fgcolor = (((self._screenfgcolor[x][y] is None) and DEFAULTFGCOLOR) or self._screenfgcolor[x][y])
    bgcolor = (((self._screenbgcolor[x][y] is None) and DEFAULTBGCOLOR) or self._screenbgcolor[x][y])
    rdelta = (((self._screenRdelta[x][y] is not None) and self._screenRdelta[x][y]) or 0)
    gdelta = (((self._screenGdelta[x][y] is not None) and self._screenGdelta[x][y]) or 0)
    bdelta = (((self._screenBdelta[x][y] is not None) and self._screenBdelta[x][y]) or 0)
    if (rdelta or gdelta or bdelta):
        (r, g, b, a) = (fgcolor.r, fgcolor.g, fgcolor.b, fgcolor.a)
        r = getwithinrange((r + rdelta))
        g = getwithinrange((g + gdelta))
        b = getwithinrange((b + bdelta))
        displayedfgcolor = pygame.Color(r, g, b, a)
        (r, g, b, a) = (self._screenbgcolor[x][y].r, self._screenbgcolor[x][y].g, self._screenbgcolor[x][y].b, self._screenbgcolor[x][y].a)
        r = getwithinrange((r + rdelta))
        g = getwithinrange((g + gdelta))
        b = getwithinrange((b + bdelta))
        displayedbgcolor = pygame.Color(r, g, b, a)
    else:
        displayedfgcolor = fgcolor
        displayedbgcolor = bgcolor
    return (displayedfgcolor, displayedbgcolor)

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseSurface.getdisplayedcolors/original