unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls, FileVersion, BlendUnit;

type
  TSplash = class(TForm)
    fv: TFileVersion;
    Shape10: TShape;
    Shape9: TShape;
    Shape8: TShape;
    Shape7: TShape;
    Shape6: TShape;
    Shape5: TShape;
    Shape4: TShape;
    Shape3: TShape;
    Shape2: TShape;
    Shape1: TShape;
    Image1: TImage;
    VerLbl: TLabel;
    TagLine: TLabel;
    Label3: TLabel;
    verlblshadow: TLabel;
    taglineshadow: TLabel;
    procedure FormCreate(Sender: TObject);
    PRocedure SetProgress(Progress: Byte);
  private
    ColorRange: TColorList;
  public
    Function ReturnColor(Value: Integer): TColor;
    Procedure SetText(Str: String);
  end;

var
  Splash: TSplash;

implementation

{$R *.dfm}

//Uses CM2PlugInTypes, CM2MMRB;

procedure TSplash.FormCreate(Sender: TObject);
begin
 ColorRange := BlendUnit.BlendColors(clWhite, $00993333, 10);
 SElf.SetProgress(0);
 fv.Filename := application.ExeName;
 VerLbl.Caption := 'Version ' + fv.FileVersion;
 VerLblShadow.caption := VerLbl.Caption;
end;

function TSplash.ReturnColor(Value: Integer): TColor;
begin
 If Value >= 10 then Begin
  Result := Colorrange[9];
  exit;
 end;
 If Value <= 0 then Begin
  Result := ColorRange[0]
 end
  else Result := ColorRange[Value];
end;

procedure TSplash.SetProgress(Progress: Byte);
begin
 If Progress >= 10 then Shape1.Brush.Color := clWhite
  else Shape1.Brush.Color := $00BA6C12;
 If Progress >= 20 then Shape2.Brush.Color := clWhite
  else Shape2.Brush.Color := $00BA6C12;
 If Progress >= 30 then Shape3.Brush.Color := clWhite
  else Shape3.Brush.Color := $00BA6C12;
 If Progress >= 40 then Shape4.Brush.Color := clWhite
  else Shape4.Brush.Color := $00BA6C12;
 If Progress >= 50 then Shape5.Brush.Color := clWhite
  else Shape5.Brush.Color := $00BA6C12;
 If Progress >= 60 then Shape6.Brush.Color := clWhite
  else Shape6.Brush.Color := $00BA6C12;
 If Progress >= 70 then Shape7.Brush.Color := clWhite
  else Shape7.Brush.Color := $00BA6C12;
 If Progress >= 80 then Shape8.Brush.Color := clWhite
  else Shape8.Brush.Color := $00BA6C12;
 If Progress >= 90 then Shape9.Brush.Color := clWhite
  else Shape9.Brush.Color := $00BA6C12;
 If Progress >= 100 then Shape10.Brush.Color := clWhite
  else Shape10.Brush.Color := $00BA6C12;
 Shape1.Brush.Color := ReturnColor(Progress);
 Shape2.Brush.Color := ReturnColor(Progress-10);
 Shape3.Brush.Color := ReturnColor(Progress-20);
 Shape4.Brush.Color := ReturnColor(Progress-30);
 Shape5.Brush.Color := ReturnColor(Progress-40);
 Shape6.Brush.Color := ReturnColor(Progress-50);
 Shape7.Brush.Color := ReturnColor(Progress-60);
 Shape8.Brush.Color := ReturnColor(Progress-70);
 Shape9.Brush.Color := ReturnColor(Progress-80);
 Shape10.Brush.Color := ReturnColor(Progress-90);

 Update;
end;

procedure TSplash.SetText(Str: String);
begin
 Label3.Caption := Str;
 Update;
end;

end.
