Question
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;
}
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;
}
Answers
There are no human answers yet.
Answered by
GPT 3.5
The second function properly removes all green and blue from a pixel and returns the modified pixel.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.