ImageEn, unit hyieutils

HexToColorDef


Declaration

function HexToColorDef(Hex: string; DefColor: TColor): TColor;


Description

Converts a hex string (e.g. from HTML), named color, "transparent" or "none" to a TColor value.

Note: Only named colors that match Delphi color names are supported


Examples

c := HexToColorDef( '#FFFFFF', clRed ); // Would return clWhite

c := HexToColorDef( 'Black', clRed ); // Would return clBlack

c := HexToColorDef( '', clRed ); // Would return clRed

c := HexToColorDef( 'None', clRed ); // Would return clNone


See Also

ColorToHex