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 theGetGrayfunction.
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
TheRGBColorrecord for one of the two colors for which you want an intermediate color.foreGround
On input, theRGBColorrecord for the other of the two colors; upon completion, the best intermediate color between these two.DESCRIPTION
TheGetGrayfunction determines the midpoint values for the red, green, and blue values of the two colors you specify in thebackGroundandforeGroundparameters. In thedeviceparameter, supply a handle to the graphics device; in thebackGroundandforeGroundparameters, supplyRGBColorrecords for the two colors for which you want the best intermediate RGB color. WhenGetGraycompletes, it returns the best intermediate color in theforeGroundparameter.One use for
GetGrayis to return the best gray. For example, when dimming an object, supply black and white as the two colors, andGetGrayreturns 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
foreGroundparameter is unchanged, and the function returnsFALSE. If at least one gray or intermediate color is available, it is returned in theforeGroundparameter, and the function returnsTRUE.