ram 2: BACK AWAY FROM THE TV! If you sat close enough to an old TV, you could see individual (R)ed, (G)reen and (B)lue (or RGB) “phosphors” that could represent just about any color you could imagine (using “additive color model”). When these three-color components are at their maximum values, the resulting color is white from a distance (which is amazing – look at your screen with a magnifying glass!). When all are off, the color results in black. If red and green are fully on, you’d get a shade of yellow; red and blue on would result in purple, and so on. For computers, each color component is usually represented by one byte (8 bits), and there are 256 different values (0-255) for each. To find the “inverse” of a color (like double-clicking your iFone® button), you subtract the RGB values from 255. The “luminance” (or brightness) of the color = (0.2126*R + 0.7152*G + 0.0722*B). For this program, you need to design (pseudocode) and implement (source code) a Color class that has R, G and B attributes (which can be ints). The constructor should take three parameters representing the initial color of (R:254, B:2, G:100). You should include 6 setter methods to increase and decrease each component (e.g. increaseRed), not to exceed 255 or be less than 0. You should include a toString() that returns a string representing the current values for each component as well as the luminance. Finally, you should include a method that calculates and prints the inverse color. Next, create a “driver” (or main) that creates a default color, prints its values to the screen, and enables the user to increase/decrease values as well as print the inverse.

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

ram 2: BACK AWAY FROM THE TV! If you sat close enough to an old TV, you could see individual (R)ed, (G)reen and (B)lue (or RGB) “phosphors” that could represent just about any color you could imagine (using “additive color model”). When these three-color components are at their maximum values, the resulting color is white from a distance (which is amazing – look at your screen with a magnifying glass!). When all are off, the color results in black. If red and green are fully on, you’d get a shade of yellow; red and blue on would result in purple, and so on. For computers, each color component is usually represented by one byte (8 bits), and there are 256 different values (0-255) for each. To find the “inverse” of a color (like double-clicking your iFone® button), you subtract the RGB values from 255. The “luminance” (or brightness) of the color = (0.2126*R + 0.7152*G + 0.0722*B). For this program, you need to design (pseudocode) and implement (source code) a Color class that has R, G and B attributes (which can be ints). The constructor should take three parameters representing the initial color of (R:254, B:2, G:100). You should include 6 setter methods to increase and decrease each component (e.g. increaseRed), not to exceed 255 or be less than 0. You should include a toString() that returns a string representing the current values for each component as well as the luminance. Finally, you should include a method that calculates and prints the inverse color. Next, create a “driver” (or main) that creates a default color, prints its values to the screen, and enables the user to increase/decrease values as well as print the inverse. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
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