Parsi Coders
Converts a TColor to a HTML Hex value - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Software Development Programming (http://parsicoders.com/forumdisplay.php?fid=37)
+--- انجمن: Pascal/Delphi (http://parsicoders.com/forumdisplay.php?fid=45)
+---- انجمن: Delphi (http://parsicoders.com/forumdisplay.php?fid=69)
+---- موضوع: Converts a TColor to a HTML Hex value (/showthread.php?tid=1467)



Converts a TColor to a HTML Hex value - Amin_Mansouri - 01-10-2012

کد:
function ColorToHex(Inp: TColor): String;
    var
    tmp: Longint;
    begin
    tmp:= ColorToRGB(inp);
    Result:= '#' + IntToHex(GetRValue(tmp),2) + IntToHex(GetGValue(tmp),2) + IntToHex(GetBValue(tmp),2);
    end;