Thema: Delphi TColor zu RGBW Hex?

Einzelnen Beitrag anzeigen

Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#3

AW: TColor zu RGBW Hex?

  Alt 18. Apr 2011, 16:53
Ich weiß zwar nicht, was W sein soll, aber ich würde es mal so probieren:
Delphi-Quellcode:
Format('%.2x%.2x%.2x%.2x',[
  Color and $ff,
  (Color shr 8) and $ff,
  (Color shr 16) and $ff,
  Color shr 24
]);
Gegebenenfalls vorher ColorToRGB aufrufen, wenn du auch Systemfarben als RGB haben möchtest.
  Mit Zitat antworten Zitat