uses System.SysUtils;
var
Red, Green, Blue, Alpha: Byte;
HtmlColor: string;
begin
Red := 51;
Green := 255;
Blue := 51;
Alpha := 128;
HtmlColor := Format('#%.2X%.2X%.2X',
[Red, Green, Blue]);
//htmlColor is #33FF33
WriteLn('style="color: ', HtmlColor, ';"');
//with transparency
HtmlColor := Format('#%.2X%.2X%.2X%.2X',
[Red, Green, Blue, Alpha]);
//htmlColor is #33FF3380
WriteLn('htmlColor is ', HtmlColor);
end.