The RGB color model is used for specifying colors. This model specifies the intensity of red, green, and blue on a scale of 0 to 255, with 0 (zero) indicating the minimum intensity. The settings of the three colors are converted to a single integer value by using this formula:

RGB value= Red + (Green*256) + (Blue*256*256)

The following table shows examples.

Red Green Blue RGB value Color

255

0

0

255

Red

0

255

0

65280

Green

0

0

255

16711680

Blue

0

255

255

16776960

Cyan

255

0

255

16711935

Magenta

255

255

0

65535

Yellow

255

255

255

16777215

White

128

128

128

8421504

Gray

0

0

0

0

Black

Expand imageExtracting Elements from an RGB Value