Write a function to swap the values of two colors, for example, swap the red value with the blue value.

What will be an ideal response?

```
def swapRedBlue(picture):
for pix in getPixels(picture):
valueBlue=getBlue(pix)
valueRed=getRed(pix)
setRed(pix,valueBlue)
setBlue(pix,valueRed)
```

Note: You could pick any swap combination of the three colors (red, green, or blue). The only change would be in which “get” and which “set” methods were used.

OR

```
def swapRedBlue(picture):
for pix in getPixels(picture):
valueBlue=getBlue(pix)
valueRed=getRed(pix)
valueGreen=getGreen(pix)
setColor(pix,makeColor(valueBlue,valueGreen,valueRed))
```

Computer Science & Information Technology

You might also like to view...

Revenue is income that a company receives from its normal business activities such as the sale of goods and services to customers

Indicate whether the statement is true or false

Computer Science & Information Technology

The istream member function _________ reads a character from the specified stream.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology