18.4. Changing Step 5: Increasing and decreasing color values¶
First example: Let’s change STEP 5, so that we decrease the red by 50%.
Try the program above on some of the other images, like “arch.jpg” or “puppy.jpg”, by changing the name of the image file on line 5. What effect does it always have? Is this what you expected when we decrease the red?
We can increase the red in a similar way. Let’s change STEP 5, so that we increase the red by 150%.
Try the program above on some of the other images by changing the name of the image file on line 5. What effect does it always have? Is this what you expected when you increase the red? What happens if you increase two colors at the same time?
Another way to get a similar effect to increasing the red, is to decrease the green and blue. Figure out how to do that in the program above and then use that information to drag the code blocks below from the left to the right in the correct order with the correct indention.
Decrease the red by .5 and increase the blue and green by .5 in puppy.jpg.