Convert the rgb values for the colours, Computer Graphics

In computers, colours are created by blending different combinations of red, green and blue. These colours are normally specified as three two-digit hexadecimal numbers in html, photoshop, gimp etc. For example, Brown is specified as A62929 to indicate the proportions of red, green and blue required. For grey shades the three proportions will always be equal. Moreover FF indicates that the colour is fully saturated. Thus red is FF0000, green is 00FF00, and blue is 0000FF. This colour system is called RGB.

Other applications, such as MATLAB require the RGB colours to be specified in terms of the fraction of each colour required. In this case, the colour is specified by three numbers between 0 and 1, with 1 representing full colour saturation. For example, Brown in this system is given as (0.65, 0.16, 0.16); while red is (1, 0, 0); green is (0, 1, 0) and blue is (0, 0, 1). This representation is referred as the RGB colour fraction.

Given that different systems are used in different applications, it is important to be able to convert between the two representations. The largest number that can be represented by a two-digit hexadecimal number is 16 FF so we know that there are 255 possible shades that can be represented.  Hence, to convert the hexadecimal colour representation to a colour fraction, the following has to be done:

1.  Convert each hexadecimal colour number to its decimal equivalent.

2.  Divide each decimal by 255.

3.  Record each fraction as the colour fraction required for that colour. Converting from a colour fraction to the hexadecimal version is the reverse of the above.

To illustrate, let us consider Brown. Its shade of red is 16 A6. As a decimal this corresponds to 166. Hence, the fraction amount of red required is 166 255 0.65. Similarly for green the decimal equivalent of 16 29 is 41. Therefore, the green colour fraction is 41 255 0.16
. The blue colour fraction for Brown is also 0.16.

(a) Convert the RGB values for the colours below to their equivalent RGB colour fractions. Round your answers to two decimal places.

389_Convert the RGB values for the colours.png

Posted Date: 3/1/2013 1:07:08 AM | Location : United States







Related Discussions:- Convert the rgb values for the colours, Assignment Help, Ask Question on Convert the rgb values for the colours, Get Answer, Expert's Help, Convert the rgb values for the colours Discussions

Write discussion on Convert the rgb values for the colours
Your posts are moderated
Related Questions
1. If you perform a x-direction shear transformation and then a y-direction shear transformation, will the result be the same as the one which is obtained when it is simultaneous s


Categorization of Light resources - Point source This is the easiest model for a light emitter. Currently rays from source obey radically diverging ways from the source positi

Q: For the following polygon, prepare an initial sorted edge list and then make the active edge list for scan lines y = 5,20,30,35 Coordinates of the vertices are as shown in Figur

Silicon Graphics - Hardware for computer animation The SGI platform is one of the most broadly used hardware platforms in professional or broadcast feature computer animation

Question 1: (a) Explain what are Final Gathering and Global Illumination and state why you would use those features when you render in MAYA. (b) List clearly the steps in

Write a polygon clipping algorithm to clip a polygon against rectangular clipping are. Read the vertices of polygon to be clipped. 2. Read the coordinates of the rectangular cl

Question: (a) Sound often gives the only effective way to convey an idea, elicit an emotion, or dramatise a point. Explain two situations of the use of sound that would be con

What is surface patch?  A single surface element can be explained as the surface traced out as two parameters (u, v) take all possible values between 0 and 1 in a two-parameter

Ellipse generating algorithm: Algorithm is similar to circle algorithm. We divide the ellipse on the positive quadrant into two regions. Region 1 where the slope > -1, and Reg