Oops... found a bug in LUCAMAR's code
If I double=click on the red color in TColorList, I get 0000FF (in html that is actually Blue)
Red is FF0000
So, for now I going back to my original code
procedure TForm3.lstColorDblClick(Sender: TObject);
var
N: Longint;
Results: String;
//TmpStr: String;
begin
N:= ColorToRGB(lstColor.Selected);
Results:= '#'+
IntToHex(Red(N), 2)+
IntToHex(Green(N), 2)+
IntToHex(Blue(N), 2);
txtSnippets.SelText:='&' + Results + ':';
end;
It needs the three IntToHEX lines
That dictates the correct RGB order.
This works.