def _MakeGray(rgbTuple, factor, maskColor):
    """
    Make a pixel grayed-out. If the pixel matches the maskcolor, it won't be
    changed.

    :type `rgbTuple`: red, green, blue 3-tuple
    :type `factor`: float
    :type `maskColor`: red, green, blue 3-tuple
    """
    r, g, b = rgbTuple
    if (r, g, b) != maskColor:
        return map(lambda x: int((230 - x) * factor) + x, (r, g, b))
    else:
        return (r, g, b)