Fórum TColor para html #230237
05/05/2004
0
Tem alguma forma automática de converter cor de TColor para o padrão HTML ?
Grato
Grato
Motta
Curtir tópico
+ 0
Responder
Posts
05/05/2004
Cebikyn
Vc pode usar esta função:
ou esta:
function ColorToHtml1(Color: TColor): string; var COL: LongInt; begin COL := ColorToRGB(Color); Result := ´#´ + IntToHex(COL and $FF, 2) + IntToHex(COL shr 8 and $FF, 2) + IntToHex(COL shr 16 and $FF, 2); end;
ou esta:
function ColorToHtml2(Clr: TColor): string; begin Result := IntToHex(clr, 6); Result := ´´ + Copy(Result, 5, 2) + Copy(Result, 3, 2) + Copy(Result, 1, 2); end;
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)