# Color space

Color space is a set of rules that allows describing colors with numbers. A computer always needs a explicit or implicit color space when it is displaying a color or an image.

#### What is a color?

The answer to this seemingly simple question requires a surprising amount of knowledge from various fields including physics, biology, and art. In this article, I will consider color to be something you can see and distinguish with your (human) eyes.

## RGB

The Red-Green-Blue color space is a probably the simplest and most natural color space. Each color is represented by 3 numbers. The numbers indicate the intensities of the 3 primary colors - red, green, and blue in range from 0% to 100%.

Imagine you are in a dark room without any windows. Though you cannot see anything you know that the walls are covered with white paint. You have 3 colored flashlights. One red, one green and one blue. The light intensities are adjustable from 0 to a maximum value. You turn on the red flashlight and you see a red circle on the wall. No surprise. Now you turn on the green flashlight. You see a green circle. Then you adjust the flashlights so that the circles overlap. You now see a new color - yellow. After turning on the last flashlight and aiming it at the same spot, the color of the circle changes to white. By adjusting the intensities of the individual flashlights, you are able to get virtually any color.

The 3 basic colors are combined (added up) in various intensities to obtain the target color. RGB is an additive color space.

As mentioned above, RGB color space is a natural color space. This is because it was designed to mimic the inner working of the human eye. The eye contains (among others) three kinds of cells that are sensitive to red, green and blue rays. If light rays of all these (RGB) colors are hitting human eyes, they appear as white.

RGB is used in most LCDs and old CRTs. If you looked very closely (possibly using a looking glass) at an old CRT, you should be able to distinguish tiny colored R-G-B areas.

## CMYK

The Cyan-Magenta-Yellow-Black color space is a counterpart of the RGB color space.

A printer puts tiny drops of ink on a white paper. The ink absorbs light rays of certain colors and reflects or transmits the others. When inks of two colors are mixing, the resulting ink absorbs light rays that were absorbed by any of the original inks.

The mixing of inks is not ideal though, the physical properties of the actual inks used in printers can get close to the ideal behavior, but not reach it. That is one of the reasons, why the Black ink is used in addition to the 3 colored inks. Another thing to consider is the color of the paper. The resulting image would look differently if printed on snow-white or yellowish paper.

Because printers and inks used by them are different, a color profile is needed to reproduce colors as accurately as possible.

CMYK is a subtractive model, because by adding more ink, the light rays that are reflected or transmitted are fewer and the resulting color darker.

## YCbCr

This color space represents each color with 3 numbers, similarly as the RGB space. The Y component represents the intensity of the light. The Cb and Cr components indicate the intensities of the blue and red components relative to the green component.

This color space exploits the properties of the human eye. The eye is more sensitive to light intensity changes and less sensitive to hue changes. When the amount of information is to be minimized, the intensity component can be stored with higher accuracy than the Cb and Cr components. The JPEG file format makes use of this color space to throw away unimportant information.

## HLS/HSB

The Hue-Luminance-Saturation and the Hue-Saturation-Brightness color spaces represent colors with 3 numbers. The hue component usually ranges from 0 to 360 degrees. The other 2 components range from 0 to 100%. The hue is intentionally using degrees because the hues are considered cyclic (0 degrees = 260 degrees). This color space is often used when drawing color wheels, when generating colors visually close to a selected color, or when making sepia images (or other monochromatic pictures).

## Colors in RealWorld Designer

RealWorld Designer applications always use the RGB color space internally. Pictures in other color spaces (such as CMYK jpegs) are converted to RGB before displaying them.

Zack_Leonhart registered user on June 30th 2011

Anonymous on February 18th 2014

But I need the colours to see my cursor then I can have a yellow circle around my cursor

Anonymous on July 22nd 2015

please elaborate little more , like which color space is to be used in which condition(s) and why .

Anonymous
Bookmark and share
Select background