[Previous] [Contents] [Index] [Next]

PgGrayValue()

Extract color brightness

Synopsis:

int PgGrayValue( PgColor_t color );

Description:

This macro converts a color into its corresponding level of gray. The calculation is based on 30% red, 59% green, and 11% blue, resulting in a value between 0 and 255.

Returns:

The gray component of the color.

Examples:

// Convert pal[i] into monochrome
pal[i] = PgGray( PgGrayValue( pal[i] ) );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgBlueValue(), PgCMY(), PgGreenValue(), PgHSV(), PgRedValue(), PgRGB(), PgSetFillColor(), PgSetFillDither()


[Previous] [Contents] [Index] [Next]