RGB Colors

RGB colors are set by using a number between 1 and 255 for each of the Red, Green, and Blue portions. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed.

The RGB value is calculated by the following equation: Red + (Green * 256) + (Blue * 65536)

The following table lists some standard colors, their red, green, and blue values, and their RGB value.

Color

Red value

Green value

Blue value

RGB value

Example

Black

0

0

0

0

 

Blue

0

0

255

16711680

 

Green

0

255

0

65280

 

Cyan

0

255

255

16776960

 

Red

255

0

0

255

 

Magenta

255

0

255

16711935

 

Yellow

255

255

0

65535

 

White

255

255

255

16777215