PgRGB()

Convert red, green, and blue values to composite color format

Synopsis:

PgColor_t PgRGB( int R, int G, int B );

Library:

ph

Description:

This macro converts red, green, and blue values into a composite color value (a PgColor_t type). The values for red, green, and blue range from 0 to 255. If you set all three arguments to 0, the color is black; if you set all three to 255, the color is white.


Note: This macro doesn't support alpha; for colors involving alpha, use PgARGB().

Examples:

Color RGB value
Black PgRGB( 0, 0, 0 );
White PgRGB( 255, 255, 255 );
Red PgRGB( 255, 0, 0 );
Green PgRGB( 0, 255, 0 );
Blue PgRGB( 0, 0, 255 );
Orange PgRGB( 255, 165, 0 );
Slate Blue PgRGB( 80, 95, 134 );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgARGB(), PgBlueValue(), PgColor_t, PgCMY(), PgGreenValue(), PgHSV(), PgRedValue(), PgSetFillColor(), PgSetStrokeColor(), PgSetTextColor()

Color in the Raw Drawing and Animation chapter of the Photon Programmer's Guide