Sign in Join
FPDoc Onlineexperiment

ColorToString function

In unit Graphics

Gets a string representation for the specified TColor value.

Declaration

pascal
function ColorToString(Color: TColor): AnsiString

Arguments

Color

The TColor value examined in the routine.

Function result

AnsiString with the hexadecimal byte values or the color identifier name for the specified color value.

Description

ColorToString converts the TColor value in the Color argument to a string representation for the color. Color may contain either a named color identifier, like clRed or clForm, or a custom color value not represented by a color identifier like TColor($00D7FF).

For named color identifiers, the return value contains the string representation for the identifier; e.g. 'clRed' or 'clForm'. For colors which are not recognized in the standard Colors map, the return value contains the hexadecimal representation for the color in ABGR (Alpha Blue Green Red) byte order; e.g. '$0000D7FF'.

Use StringToColor or StringToColorDef to convert the string representation for a color to its TColor equivalent.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.