| |
| Converting a TColor value to a HTML Color string |
 |
How can I convert a TColor value to a HTML Color string?
The following example demonstrates converting a TColor to a RGB color, and formating the RGB color to be shown as hexadecimal digits.
procedure TForm .Button Click(Sender: TObject);
var
TheRgbValue : TColorRef;
begin
if ColorDialog .Execute then begin
TheRgbValue := ColorToRGB(ColorDialog .Color);
ShowMessage(Format('%.2x%.2x%.2x',
[GetRValue(TheRGBValue),
GetGValue(TheRGBValue),
GetBValue(TheRGBValue)]));
end;
end;
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|