Aqui el codigo:
delphi
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons; type TFGeneraColor = class(TForm) Panel1: TPanel; tbRojo: TTrackBar; tbVerde: TTrackBar; tbAzul: TTrackBar; ldtRojo: TLabeledEdit; ldtVerde: TLabeledEdit; ldtAzul: TLabeledEdit; rgColores: TRadioGroup; BClose: TBitBtn; procedure tbRojoChange(Sender: TObject); procedure FormShow(Sender: TObject); procedure ldtRojoKeyPress(Sender: TObject; var Key: Char); procedure ldtRojoExit(Sender: TObject); procedure ldtVerdeExit(Sender: TObject); procedure ldtAzulExit(Sender: TObject); procedure rgColoresClick(Sender: TObject); procedure BCloseClick(Sender: TObject); private { Private declarations } procedure ActualizaPanel; procedure ActualizaEdits; public { Public declarations } end; var FGeneraColor: TFGeneraColor; implementation {$R *.dfm} procedure TFGeneraColor.ActualizaPanel; begin panel1.Color := RGB(tbRojo.Position,tbVerde.Position,tbAzul.Position); end; procedure TFGeneraColor.ActualizaEdits; begin ldtRojo.Text := IntToStr(tbRojo.Position ); ldtVerde.Text := IntToStr(tbVerde.Position ); ldtAzul.Text := IntToStr(tbAzul.Position ); end; procedure TFGeneraColor.FormShow(Sender: TObject); begin tbRojo.Position := 0; tbVerde.Position := 0; tbAzul.Position := 0; ActualizaEdits; ActualizaPanel; end; procedure TFGeneraColor.tbRojoChange(Sender: TObject); begin ActualizaEdits; ActualizaPanel; end; procedure TFGeneraColor.ldtRojoKeyPress(Sender: TObject; var Key: Char); begin if not (Key in ['0'..'9',#8,#13]) then key := #0; end; procedure TFGeneraColor.ldtRojoExit(Sender: TObject); begin if StrToInt(ldtRojo.Text) > 255 then ldtRojo.Text := '255'; tbRojo.Position := StrToInt(ldtRojo.Text ); ActualizaEdits; ActualizaPanel; end; procedure TFGeneraColor.ldtVerdeExit(Sender: TObject); begin if StrToInt(ldtverde.Text) > 255 then ldtVerde.Text := '255'; tbVerde.Position := StrToInt(ldtVerde.Text ); ActualizaEdits; ActualizaPanel; end; procedure TFGeneraColor.ldtAzulExit(Sender: TObject); begin if StrToInt(ldtAzul.Text) > 255 then ldtAzul.Text := '255'; tbAzul.Position := StrToInt(ldtAzul.Text ); ActualizaEdits; ActualizaPanel; end; procedure TFGeneraColor.rgColoresClick(Sender: TObject); begin case rgColores.ItemIndex of 0: begin tbRojo.Position := 255;tbverde.Position := 255;tbazul.Position := 0; end; 1: begin tbRojo.Position := 0;tbverde.Position := 0;tbazul.Position := 255; end; 2: begin tbRojo.Position := 255;tbverde.Position := 255;tbazul.Position := 255; end ; 3: begin tbRojo.Position := 127;tbverde.Position := 127;tbazul.Position := 127; end; 4: begin tbRojo.Position := 0;tbverde.Position := 0;tbazul.Position := 0; end ; 5: begin tbRojo.Position := 255;tbverde.Position := 0;tbazul.Position := 0; end; 6: begin tbRojo.Position := 0;tbverde.Position := 255;tbazul.Position := 0; end; end; end; procedure TFGeneraColor.BCloseClick(Sender: TObject); begin Close; end; end.
Alguien me paso este codigo y pues le hice algunas modificasiones.
Un Saludo.