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.  C++ Please!

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter7: Input/output Technology
Section: Chapter Questions
Problem 1VE
icon
Related questions
Question

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. 

C++ Please!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Research
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.
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning