Lightweight Graphics

GMakeColor

Make a color from red, green and blue

Syntax

Signature
int GMakeColor( int red, int green, int blue );

Arguments

red, green, blue give the three color components. Each component is clamped to the range 0 through 255.

Return value

The color as 0xRRGGBB.

Description

Packs the three components into one RGB value. For example, GMakeColor( 128, 0, 128 ) produces 0x800080. Pass the result to drawing functions such as GPutPixel() or GRect().

Example

gmakecolor.c
#include "xdev-wtui.h"

int main( void )
{
   GRect( 10, 10, 60, 60, GMakeColor( 128, 0, 128 ), T );

   Inkey( 0, NIL );

   return 0;
}

See also