- 人气:
 
  
- 放大
 
- 缩小
 
 
- 二维码
 
- 赞赏
 
 
delphi 如何将颜色值转换为HTML格式?
function GetHTMLColor(cl: TColor; IsBackColor: Boolean): string;
var rgbColor: TColorRef;
begin
  if IsBackColor then
    Result := 'bg'
  else
    Result := '';
  rgbColor := ColorToRGB(cl);
  Result := Result + 'color="#' + Format('%.2x%.2x%.2x',
                                            [GetRValue(rgbColor),
                                             GetGValue(rgbColor),
                                             GetBValue(rgbColor)]) + '"';
end;