unit Main

interface

uses
  SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ScrollBar1: TScrollBar;
    ScrollBar2: TScrollBar;
    ScrollBar3: TScrollBar;
    ScrollBar4: TScrollBar;
    Red: TLabel;
    Green: TLabel;
    Blue: TLabel;
    Clr: TLabel;
    Label1: TLabel;
    procedure ScrollBar1Change(Sender: TObject);
    procedure ScrollBar4Change(Sender: TObject);
  private
    procedure UpdateAll;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.UpdateAll;
begin
 Form1.Color := RGB(ScrollBar1.Position,
                    ScrollBar2.Position,
                    ScrollBar3.Position);
 Red.Caption := 'Red = ' + IntToStr(ScrollBar1.Position);
 Green.Caption := 'Green = ' + IntToStr(ScrollBar2.Position);
 Blue.Caption := 'Blue = ' + IntToStr(ScrollBar3.Position);
 Clr.Caption := 'RGB Color = ' + IntToStr(Form1.Color);
end;

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
 UpdateAll;
end;

procedure TForm1.ScrollBar4Change(Sender: TObject);
begin
 ScrollBar1.Position := ScrollBar4.Position;
 ScrollBar2.Position := ScrollBar4.Position;
 ScrollBar3.Position := ScrollBar4.Position;
end;

end.