Which of the following functions properly removes all green and blue from a pixel and returns the modified pixel?

var RED = 0;
var GREEN = 1;
var BLUE = 2;
function removeGreenAndBlue(pixel) {
pixel[RED] = 255;
return pixel;
}

var RED = 0;
var GREEN = 1;
var BLUE = 2;
function removeGreenAndBlue(pixel) {
pixel[GREEN] = 0;
pixel[BLUE] = 0;
return pixel;
}

var RED = 0;
var GREEN = 1;
var BLUE = 2;
function removeGreenAndBlue(pixel) {
pixel[GREEN] = 0;
pixel[BLUE] = 0;
}

function removeGreenAndBlue(pixel) {
pixel.setGreen(0);
pixel.setBlue(0);
return pixel;
}

1 answer

The second function properly removes all green and blue from a pixel and returns the modified pixel.
Similar Questions
  1. Question: 3Which of the following pixels has a color value of #ff0000 (expressed in hexadecimal) (White Pixel) (Blue Pixel)
    1. answers icon 1 answer
  2. Question: 1We want to write a brightness filter that brightens a given pixel. Which of the following instructions would brighten
    1. answers icon 1 answer
  3. What happens when all three RGB values are set to 255?Question 3 options: The pixel turns white The pixel turns red The pixel
    1. answers icon 1 answer
    1. answers icon 1 answer
more similar questions