unit mainWin;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, HueSelector, SVColorMap, ComCtrls, HSColorMap, SaturationSelector,
  ValueSelector, ColorDialog, ColorContainer, StdCtrls;

type
  TForm5 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    HueSelector1: THueSelector;
    SVColorMap1: TSVColorMap;
    HSColorMap1: THSColorMap;
    TrackBar1: TTrackBar;
    TabSheet3: TTabSheet;
    HueSelector2: THueSelector;
    SaturationSelector1: TSaturationSelector;
    ValueSelector1: TValueSelector;
    ColorDialog1: TColorDialog;
    ColorContainer1: TColorContainer;
    ColorContainer2: TColorContainer;
    ColorContainer3: TColorContainer;
    ColorContainer4: TColorContainer;
    Button1: TButton;
    procedure HueSelector1Change(Sender: TObject);
    procedure SVColorMap1Change(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
    procedure HSColorMap1Change(Sender: TObject);
    procedure SaturationSelector1Change(Sender: TObject);
    procedure HueSelector2Change(Sender: TObject);
    procedure ValueSelector1Change(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);
begin
  Close
end;

procedure TForm5.FormCreate(Sender: TObject);
begin
//  ColorDialog1.Color := rgb($33, $cc, $ff);
//  if ColorDialog1.Execute then Color := ColorDialog1.Color;
end;

procedure TForm5.HSColorMap1Change(Sender: TObject);
begin
  Caption := Format('h: %f; s: %f; v: %f', [HSColorMap1.Hue, HSColorMap1.Saturation, HSColorMap1.Value])
end;

procedure TForm5.HueSelector1Change(Sender: TObject);
begin
  SVColorMap1.Hue := HueSelector1.Hue;
  SVColorMap1.Update;
end;

procedure TForm5.HueSelector2Change(Sender: TObject);
begin
  SaturationSelector1.Hue := HueSelector2.Hue;
  ValueSelector1.Hue := HueSelector2.Hue;
end;

procedure TForm5.SaturationSelector1Change(Sender: TObject);
begin
  Caption := FloatToStr(SaturationSelector1.Saturation)
end;

procedure TForm5.SVColorMap1Change(Sender: TObject);
begin
  Caption := Format('h: %f; s: %f; v: %f', [SVColorMap1.Hue, SVColorMap1.Saturation, SVColorMap1.Value])
end;

procedure TForm5.TrackBar1Change(Sender: TObject);
begin
  HSColorMap1.Value := (100 - TrackBar1.Position) / 100;
  HSColorMap1.Update;
end;

procedure TForm5.ValueSelector1Change(Sender: TObject);
begin
  Caption := FloatToStr(ValueSelector1.Value);
end;

end.
