Representing colors using 24-bit RGB values

 

Some API commands, such as IN_PlaceText, allow you to represent colors using 24-bit RGB values instead of using the default list of 16 colors.

The number assigned to color attributes is calculated using the red, green, and blue components of the color, according to the following formula:

 RGB = (R*65536) + (G*256) + B

where R, G, and B are numbers from 0 to 255 assigned to the red, green, and blue colors.

The following chart lists the values for the colors available through the Imagenation user interface:

Color

R, G, B

24-bit value

background

0, 0, 0

0

blue

0, 0, 255

255

cyan

0, 255, 255

65535

red

255, 0, 0

16711680

yellow

255, 255, 0

16776960

green

0, 255, 0

65280

magenta

255, 0, 255

16711935

gray

192, 192, 192

12632256

dark blue

0, 0, 128

128

dark cyan

0, 128, 128

32896

dark red

128, 0, 0

8388608

dark yellow

128, 128, 0

8421376

dark green

0, 128, 0

32768

dark magenta

128, 0, 128

8388736

dark gray

128, 128, 128

8421504

foreground

255, 255, 255

16777215