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
aleksandr82 [10.1K]
3 years ago
13

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 gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part.
Ex: If the input is 130 50 130, the output is: 80 0 80

Required:
Find the smallest value, and then subtract it from all three values, thus removing the gray.
Computers and Technology
1 answer:
Effectus [21]3 years ago
8 0

Answer:

<em>The programming language is not stated; However, I'll answer the question using C++ programming language, </em>

<em>This program uses comments for explanations  </em>

<em>Program starts here</em>

#include<iostream>

using namespace std;

int main()

{

//Declare Array

int colorcode[3],graycode[3];

//Prompt user for color code

cout<<"Enter Color Code (One on a line)"<<endl<<"Inout Range is 0 to 255"<<endl;

for(int i = 0;i<3;i++)

{

 ccode:  

 cout<<"Enter Color Code "<<i+1<<": ";

 cin>>colorcode[i];

 if(colorcode[i]<0 || colorcode[i]>255)

 {

  cout<<"Input Range is 0 to 255"<<'\n';

  goto ccode;

 }

}

//Initialize smallest to colorcode[0]

int smallest = colorcode[0];

//Determine smallest

for(int i = 0;i<3;i++)

{

 if(colorcode[i]<smallest)

 {

  smallest = colorcode[i];

 }

}

//Determine Graycode

for(int i = 0;i<3;i++)

{

 graycode[i] = colorcode[i] - smallest;

}

//Display Result:

cout<<"Color Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<colorcode[i]<<",";  

 }

 else

 {

  cout<<colorcode[i]<<")"<<endl;  

 }  

}

cout<<"Gray Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<graycode[i]<<",";  

 }

 else

 {

  cout<<graycode[i]<<")"<<endl;  

 }  

}

return 0;

}

You might be interested in
Are one of the greatest features of Photoshop that allow nondestructive editing of images.
ioda

Answer:

The answer is explained below

Explanation:

They are many features in photoshop that allow for nondestructive editing of images, these are:

  1. Dialog box: It also for the user to undo an activity to the last change
  2. Layer: It contain data that can be adjusted to change the appearance of an image.
  3. Mask: It protect a designated portion from changes you want to make.
  4. Smart Objects: It allows for the editing of an image without altering or damaging the original image
  5. Revert: It allows you to go back to the original image as it was when you opened the document.
  6. Crop: After cropping an image you can choose to hide the cropped part instead of deleting it.
7 0
3 years ago
A surface
givi [52]

Answer:

3 Pa

Explanation:

pressure = force / area

6 0
3 years ago
Which type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals?
tester [92]
The <span>type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals is called "Panel Interview." The interviewee is surrounded with 2 or more panelists that will ask questions that you need to answer.</span>
3 0
3 years ago
Read 2 more answers
What is the purpose of "display:table"?
igor_vitrenko [27]

Answer:

Modern browsers use CSS to style all their markup.

How would they render a <table> element if CSS had nothing that could express the appearance of one?

(That, and you might have non-tabular data that you want to render like a table, there are enough people using tables for layout to see a demand for it).

They can be used to format content in a tabular manner when the markup does not use the table element, e.g. because the markup was written by someone who was told not use tables or because the markup is generic XML and not HTML.

You can also design a page using e.g. div elements so that some stylesheet formats them as a table, some other stylesheet lets them be block elements or turns them to inline elements. This may depend e.g. on the device width

5 0
3 years ago
What internal hardware device does a computer use to connect to a wired or a wireless network?
IrinaVladis [17]

Answer:

it will be ethernet and wireless network adapter

Explanation:because, wireless card is will able to connect to network wirelessly ,ethernet card will connect to network with ethernet cable RG45

if you give more info about your question will; try to help you better.

Thanks

8 0
3 years ago
Other questions:
  • Pollution or waste that is generated from a business is called a
    6·2 answers
  • what tool can a student use to make sure his or her work paper does not take credit for someone else's work ?
    5·1 answer
  • Name the months that have 30 days​
    6·2 answers
  • What did I do wrong? May you please correct it for me...I was also looking on how to delay when it prints. Like when it prints a
    9·1 answer
  • If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
    6·2 answers
  • Microsoft Windows is the least used operating system. TRUE or FALSE.
    13·1 answer
  • As a general rule, the number of bullet points on a slide should not exceed _____. a.2 b.4 c.8 d.10
    9·1 answer
  • D) Informal high level descuption of an algorithm in english kcalled
    9·2 answers
  • You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money a
    10·1 answer
  • When Alice turned on her laptop this morning, the screen displayed only colorful horizontal lines. Which of the following is mos
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!