unit testform; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,colorpicker, StdCtrls, ComCtrls; type TForm1 = class(TForm) ColorDialog1: TColorDialog; Button1: TButton; Label1: TLabel; Label2: TLabel; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } procedure cc(sender : TObject); end; var Form1: TForm1; cp : TColorpicker; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin ColorDialog1.execute; cp.Col:=colordialog1.color; label2.caption:=inttostr(GetRValue(ColorToRGB(colordialog1.color)))+' - '+inttostr(GetGValue(ColorToRGB(colordialog1.color)))+' - '+inttostr(GetBValue(ColorToRGB(colordialog1.color))); end; procedure TForm1.FormCreate(Sender: TObject); begin cp:=Tcolorpicker.Create(self); cp.Height:=240; cp.Width:=240; //cp.Align:=alClient; cp.OnColorChange:=cc; end; procedure TForm1.cc(Sender : TObject); begin //color:=cp.Col; label1.caption:=inttostr(GetRValue(ColorToRGB(cp.col)))+' - '+inttostr(GetGValue(ColorToRGB(cp.col)))+' - '+inttostr(GetBValue(ColorToRGB(cp.col))); end; end.