What you're describing is modular arithmetic. You can use the modulo operator to do this:
def makeChange(pic):
for p in getPixels(pic):
r = int(getRed(p))
g = int(getGreen(p))
b = int(getBlue(p))
color = makeColor((r + 10) % 255, (g - 20) % 255, (b - 10) % 255)
setColor(p, color)