Examples If the input is: 130 50 130 the output should be: (80, 0, 80) Note: You will always have at least one zero in the resulting tuple. If you had (130, 50, 130) you will have (80, 0, 80). If you had (100, 5, 100) you will have (95, 0, 95). Note: This page converts the RGB values into colors, so you can visualize the values as colors. 414136.2652726.qx3zqy7 LAB ACTIVITY 3.18.1: LAB: Different shades of grey 1 # Define your function here. 3 if _name__ == '____main__': 4 5 main.py # Type your code here. Your code must call the function. 0/8 Load default template...

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter7: Input/output Technology
Section: Chapter Questions
Problem 27VE
icon
Related questions
Question
Examples
If the input is:
130
50
130
the output should be:
(80, 0, 80)
Note: You will always have at least one zero in the resulting tuple. If you had (130, 50, 130) you will have (80, 0, 80). If you had (100,
5, 100) you will have (95, 0, 95).
Note: This page converts the RGB values into colors, so you can visualize the values as colors.
414136.2652726.qx3zqy7
LAB
ACTIVITY
3.18.1: LAB: Different shades of grey
1 # Define your function here.
2
3 if name == '__main__":
4
5
main.py
# Type your code here. Your code must call the function.
0/8
Load default template...
Transcribed Image Text:Examples If the input is: 130 50 130 the output should be: (80, 0, 80) Note: You will always have at least one zero in the resulting tuple. If you had (130, 50, 130) you will have (80, 0, 80). If you had (100, 5, 100) you will have (95, 0, 95). Note: This page converts the RGB values into colors, so you can visualize the values as colors. 414136.2652726.qx3zqy7 LAB ACTIVITY 3.18.1: LAB: Different shades of grey 1 # Define your function here. 2 3 if name == '__main__": 4 5 main.py # Type your code here. Your code must call the function. 0/8 Load default template...
Introduction
Computers represent color by combining the sub-colors red, green, and blue (RGB). Each sub-color's value can range from 0 to 255. Thus,
(255, 0, 0) is bright red,
(130, 0, 130) is a medium purple,
(0, 0, 0) is black,
●
●
• (255, 255, 255) is white, and
• (40, 40, 40) is a dark grey.
Equal amounts of red, green, blue result in different shades of grey. Note that (130, 50, 130) is a faded purple, due to the (50, 50, 50)
grey part.
Given integer values for red, green, and blue, you will subtract the grey from each value and report the results.
Instructions
The function
Write a function subtract_grey() that takes as input a tuple with three integer values. These values represent the sub-colors red, green,
and blue (RGB).
The function should return a new tuple that results from decrementing all values by the smallest value, thus removing the grey. You need to
use the comparison operators <> ==, and to cover all the cases i.e. if only one is the min, if two numbers are equal and if they are all equal
The main program
In your main program, ask the user for 3 numbers and create the tuple that you will use as an argument into the subtract_grey()
function.
In your main program, print the result of calling the subtract_grey () function.
Transcribed Image Text:Introduction Computers represent color by combining the sub-colors red, green, and blue (RGB). Each sub-color's value can range from 0 to 255. Thus, (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, ● ● • (255, 255, 255) is white, and • (40, 40, 40) is a dark grey. Equal amounts of red, green, blue result in different shades of grey. Note that (130, 50, 130) is a faded purple, due to the (50, 50, 50) grey part. Given integer values for red, green, and blue, you will subtract the grey from each value and report the results. Instructions The function Write a function subtract_grey() that takes as input a tuple with three integer values. These values represent the sub-colors red, green, and blue (RGB). The function should return a new tuple that results from decrementing all values by the smallest value, thus removing the grey. You need to use the comparison operators <> ==, and to cover all the cases i.e. if only one is the min, if two numbers are equal and if they are all equal The main program In your main program, ask the user for 3 numbers and create the tuple that you will use as an argument into the subtract_grey() function. In your main program, print the result of calling the subtract_grey () function.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
External Style Sheet
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L