Question: Write a function called changeColor that takes as input a picture and an amount to increase or decrease a color by and a number 1

Write a function called changeColor that takes as input a picture and an amount to increase or decrease a color by and a number 1 (for red), 2 (for green), or 3 (for blue). The amount will be a number between −.99 and .99.

• ChangeColor(pict,−.10,1) should decrease the amount of red in the picture by 10%.
• ChangeColor(pict,.30,2) should increase the amount of green in the picture by 30%.
• ChangeRed(pict,0,3) should do nothing at all to the amount of blue (or red or green) in the picture.

Step by Step Solution

3.34 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def changeColorpicture amount number for p in getPix... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!