Maybe try this function
function
TColorToHex( Color : TColor )
: string;
begin
Result :=
{ red value }
IntToHex( GetRValue( Color ), 2 ) +
{ green value }
IntToHex( GetGValue( Color ), 2 ) +
{ blue value }
IntToHex( GetBValue( Color ), 2 );
end;
Regards
Dave