Important: The information in this document is obsolete and should not be used for new development.
GetGrayTo determine the best intermediate color between two colors on a given graphics device, use the
FUNCTION GetGray (device: GDHandle; backGround: RGBColor; VAR foreGround: RGBColor): Boolean;
- A handle to the graphics device for which an intermediate color or gray is needed.
RGBColorrecord for one of the two colors for which you want an intermediate color.
On input, the
RGBColorrecord for the other of the two colors; upon completion, the best intermediate color between these two.
GetGrayfunction determines the midpoint values for the red, green, and blue values of the two colors you specify in the
foreGroundparameters. In the
deviceparameter, supply a handle to the graphics device; in the
RGBColorrecords for the two colors for which you want the best intermediate RGB color. When
GetGraycompletes, it returns the best intermediate color in the
One use for
GetGrayis to return the best gray. For example, when dimming an object, supply black and white as the two colors, and
GetGrayreturns 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 returns
FALSE. If at least one gray or intermediate color is available, it is returned in the
foreGroundparameter, and the function returns