Write a method that modifies the red, green, and blue values of a picture by different amounts. Try it out on diĀ®erent pictures to see if you get any nice results.

What will be an ideal response?


```
public void changeColors (double redAmount ,
double greenAmount ,
double blueAmount )
{
Pixel [ ] pixelArray = this . getPixels ( ) ;
int value = 0 ;
// loop through al l the pixels
for ( Pixel pixel : pixelArray )
{
// change the red value
value = pixel . getRed ( ) ;
pixel . setRed ( ( int ) ( redAmount * value ) ) ;
// change the green value
value = pixel.getGreen ( ) ;
pixel . setGreen ( ( int ) ( greenAmount * value ) ) ;
// change the bluevalue
value = pixel.getBlue ( ) ;
```

Computer Science & Information Technology

You might also like to view...

Describe four general guidelines you should follow when scheduling a meeting.

What will be an ideal response?

Computer Science & Information Technology

The text that appears alongside a JCheckBox is referred to as the _____________.

a) JCheckBox value b) JCheckBox name c) JCheckBox text d) JCheckBox data

Computer Science & Information Technology

In SharePoint Online, folders can contain up to ________ items

A) 50,000 B) 10,000 C) 5,000 D) 1,000

Computer Science & Information Technology

Lines, arrows, stars, banners, ovals, and rectangles are examples of ________ that can be used on a PowerPoint slide

Fill in the blank(s) with correct word

Computer Science & Information Technology