Important: The information in this document is obsolete and should not be used for new development.
GetGray
To determine the best intermediate color between two colors on a given graphics device, use theGetGray
function.
FUNCTION GetGray (device: GDHandle; backGround: RGBColor; VAR foreGround: RGBColor): Boolean;
device
- A handle to the graphics device for which an intermediate color or gray is needed.
backGround
TheRGBColor
record for one of the two colors for which you want an intermediate color.foreGround
On input, theRGBColor
record for the other of the two colors; upon completion, the best intermediate color between these two.DESCRIPTION
TheGetGray
function determines the midpoint values for the red, green, and blue values of the two colors you specify in thebackGround
andforeGround
parameters. In thedevice
parameter, supply a handle to the graphics device; in thebackGround
andforeGround
parameters, supplyRGBColor
records for the two colors for which you want the best intermediate RGB color. WhenGetGray
completes, it returns the best intermediate color in theforeGround
parameter.One use for
GetGray
is to return the best gray. For example, when dimming an object, supply black and white as the two colors, andGetGray
returns the best available gray that lies between them. (The Menu Manager does this when dimming unavailable menu items.)If no gray is available (or if no distinguishable third color is available), the
foreGround
parameter is unchanged, and the function returnsFALSE
. If at least one gray or intermediate color is available, it is returned in theforeGround
parameter, and the function returnsTRUE
.