Open In App

# Computer Graphics | The RGB color model

The RGB color model is one of the most widely used color representation method in computer graphics. It use a color coordinate system with three primary colors:

`R(red), G(green), B(blue) `

Each primary color can take an intensity value ranging from 0(lowest) to 1(highest). Mixing these three primary colors at different intensity levels produces a variety of colors. The collection of all the colors obtained by such a linear combination of red, green and blue forms the cube shaped RGB color space.

The corner of RGB color cube that is at the origin of the coordinate system corresponds to black, whereas the corner of the cube that is diagonally opposite to the origin represents white. The diagonal line connecting black and white corresponds to all the gray colors between black and white, which is also known as gray axis.

In the RGB color model, an arbitrary color within the cubic color space can be specified by its color coordinates: (r, g.b).

Example:

```(0, 0, 0) for black, (1, 1, 1) for white,
(1, 1, 0) for yellow, (0.7, 0.7, 0.7) for gray ```

Color specification using the RGB model is an additive process. We begin with black and add on the appropriate primary components to yield a desired color. The concept RGB color model is used in Display monitor. On the other hand, there is a complementary color model known as CMY color model. The CMY color model use a subtraction process and this concept is used in the printer.

In CMY model, we begin with white and take away the appropriate primary components to yield a desired color.

Example:
If we subtract red from white, what remains consists of green and blue which is cyan. The coordinate system of CMY model use the three primaries’ complementary colors:

`C(cray), M(magenta) and Y(yellow) `

The corner of the CMY color cube that is at (0, 0, 0) corresponds to white, whereas the corner of the cube that is at (1, 1, 1) represents black. The following formulas summarize the conversion between the two color models: