PgGray
PgGray — converts a gray level index from 8-bit to 24-bit color.
Syntax
PgGray (gray_level)
Arguments
- gray_level
A level for gray between 0 - 255
decimal (0x00-0xff hex).
Returns
A 24-bit color representation of the gray_level.
Description
This function converts a gray level index from 8-bit to 24-bit color.
For example, an image may contain 256 shades of gray. To convert
those grays to 24-bit color use this function to acquire the 24-bit
equivalents.
Example
Gamma> BLACK = PgGray(0);
0x0
Gamma> WHITE = PgGray(255);
0xffffff
Gamma> MEDGRAY = PgGray(128);
0x808080
Gamma> WHITE = PgRGB(255,255,255);
0xffffff
Gamma> PgGray(0xff) == WHITE;
t