def grayScale(picture):
for p in getPixels(picture):
intensity = (getRed(p)+getGreen(p)+getBlue(p))/3
setColor(p, makeColor(255-intensity, 255-intensity, 255-intensity))
repaint(picture)
for p in getPixels(picture):
intensity = (getRed(p)+getGreen(p)+getBlue(p))/3
setColor(p, makeColor(255-intensity, 255-intensity, 255-intensity))
repaint(picture)
No comments:
Post a Comment