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...

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education