1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andrew [12]
3 years ago
10

PLEASE HELP ME FIX THIS CODE.

Computers and Technology
1 answer:
mr Goodwill [35]3 years ago
8 0

PLEASE HELP ME FIX THIS CODE.

I WANT IT TO HAVE USER INPUT TO CHANGE AND IMAGE FILTER TO BLUE RED OR GREEN.

user_color = input("What color would you like to paint the canvas, blue, red or green?:")

def user_red(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def user_green(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def user_blue(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def custom_filter(image, user_color):

for x in range(image.get_width()):

for y in range(image.get_height()):

pixel = image.get_pixel(x,y)

new_colors = invert_pixel(pixel)

image.set_red(x, y, new_colors[0])

image.set_green(x, y, new_colors[1])

image.set_blue(x, y, new_colors[2])

return image

def change_image():

global image

image = custom_filter(image, user_color)

timer.set_timeout(change_image, IMAGE_LOAD_TIME)

You might be interested in
I need an If else statement that sorts three numbers from a file from least to greatest
Vera_Pavlovna [14]
Void sort3(int& a, int& b, int& c)
{
if (a > b)
{
std::swap(a, b);
}
if (b > c)
{
std::swap(b, c);
}
if (a > b)
{
std::swap(a, b);
}
}
5 0
2 years ago
What is the language of computers?
myrzilka [38]

<em>Answer:</em>

<em>Computers have language of their own. It is called Binary language. </em>

<em>It’s a very simple language with just 2 symbols – 0 and 1. A computer stores all information in the form of 0’s and 1’s.</em>

3 0
3 years ago
Anyone wanna hop on 1v1.lol<br> party code : usfhb6
hjlf

Answer:

thx for the points

Explanation:

8 0
3 years ago
Read 2 more answers
What are the differences between sequential and random files? Which one do you think is better and why?
sukhopar [10]

Answer:

Sequential is better

Explanation:

Sequential is more organized while the more easier to make but less dependable one is random.

sequential is used for things such as date of birth, or where someone was born.

you can't do that with a random file.

5 0
4 years ago
A computer connected to the internet that asks for data is a ________. aggregator surrogate server client
Tems11 [23]
The answer to this question would be client.

Client is the computer that most people use. When you browsing a web using the internet, your computer will ask for data from the web server and the data will be arranged into graphical picture or words what you see on your monitor. Server is the computer that gives data the client ask for.
3 0
3 years ago
Other questions:
  • What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
    7·1 answer
  • The type of business organization that can continue indefinitely is known as a
    11·1 answer
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    10·1 answer
  • You want to centrally back up the files users store in the Documents folder in their user profiles, but you don’t want users to
    7·1 answer
  • Design aPayrollclass that has fields for an employee’sname, ID number, hourly pay rate,and number of hours worked. Write theappr
    9·1 answer
  • Lifelong learning _____. is only important for professionals with advanced degrees can be formal or informal includes formal cla
    12·1 answer
  • Write a complete method from the client perspective that duplicates each element in place in a ListInterface object. For example
    8·1 answer
  • Create an array class consisting of a static array of three elements, and describe it in such a way that the Point and Vector cl
    8·1 answer
  • Josh is learning about hackers know for finding loopholes in systems, without notifying the company or organization beforehand.
    13·1 answer
  • In python, what is the difference between a dictionary and a set? How are they similar?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!