Which one of the following is the correct implementation of moreRed?
// write your code here
function moreRed(pixel, amount) {
var r = pixel.getRed() + amount;
if (r > 255) r = 255;
pixel.setRed(r);
return pixel;
}
var image = new SimpleImage ("eastereggs.jpg");
print (image);
for ( var pixel of image.values()){
if (moreRed(pixel, 200) ){
}
}
print (image);
No comments:
Post a Comment