[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Converts the specified string representation for a color to a TColor value using a specified default value.
Source position: graphics.pp line 1924
function StringToColorDef( |
const S: shortstring; |
const DefaultValue: TColor |
):TColor; |
S |
|
String with the color identifier or hexadecimal byte values converted in the routine. |
DefaultValue |
|
Default TColor value used when S is not a valid representation for a color. |
TColor value for the specified string, or the default value when S does not contain a valid representation for a color.
StringToColorDef is used to convert the string in S to its value as a TColor type. The S argument can contain a color identifier like 'clRed' or 'clForm', or a hexadecimal string with the bytes for the color in GBR byte order like '$00D7FF'. The DefaultValue argument contains the default value used when S is not a valid color string.
The return value contains the LongInt value for the color. When S is a valid color identifier, the corresponding color constant is returned; e.g. clRed or clForm. If S is not a color identifier, it is converted to an Integer value and cast to the TColor type for use as the return value. The default return value is specified in the DefaultValue argument.
|
Converts the specified string representation for a color to a TColor value. |
|
|
Gets a string representation for the specified TColor value. |
|
|
IdentToColor - given a color identifier (name) returns the color value. |
Version 4.0 | Generated 2025-05-03 | Home |