The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ContrastBWColor


Unit: SDL_sdlcolors
Class: none
Declaration: [1] function ContrastBWColor (Color: TColor): TColor;
[2] function ContrastBWColor (Color: TColor; Threshold: integer): TColor;

The function ContrastBWColor returns either clblack or clwhite depending on the parameter Color. The returned color provides the greatest contrast to the color given the parameter Color. Version [1] uses a predefined threshold value of 140, version [2] allows setting the threshold value. The parameter Threshold is a gray value with a valid range between 0 (black) and 255 (white).



Last Update: 2024-Jan-10