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....



ObtainColorName


Unit: SDL_sdlcolors
Class: none
Declaration: [1] function ObtainColorName (Cl: TColor): string;
[2] function ObtainColorName (Cl: TColor; IncludeHexCode: boolean): string;

The function ObtainColorName searches the array AllSDLColors for a match with the parameter cl and returns the name of the color if there is a match, or the 8-digit hexadecimal color code if there is no match.

Version [2] of ObtainColorName allows to enforce the display of the hex code even if a color name is found by setting the parameter IncludeHexCode to TRUE. In this case the hex code is followed by the color name in parantheses (if a name is found).


Last Update: 2023-Feb-06