Hallo blackbirdXXX!
Ich tip, du brauchst das für deinen HTLM-Editor, oder?
Also: Delphi hat irgendwie die blöde Eigenschaft, statt RGB - BGR-Farben zu benutzen. Also musst du deine Hex zerlegen:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
| var ins: Integer; color, bgr, r, g, b: String; begin if colord.Execute then begin ins := ColorToRGB(colord.Color); bgr := IntToHex(ins, 6); r:= bgr; g:= bgr; b:= bgr; Delete(r,1,4); Delete(b,3,4); Delete(g,1,2); Delete(g,3,2); color:= r + g + b; Richedit1.SelText := '#' + color; end; |
So, das wars!
Stefan