Value(Col2) * (100 - Percentage) / 100));
Mix := RGB(R, G, B);
end;
function MMix(Cols: array of TColor): TColor;
var
I, R, G, B, Length: Integer;
begin
Length := High(Cols) - Low(Cols) + 1;
R := 0; G := 0; B := 0;
for I := Low(Cols) to High(Cols) do
begin
R := R + GetRValue(Cols[I]);
G := G + GetGValue(Cols[I]);
B := B + GetBValue(Cols[I]);
end;
R := R div Length;
G := G div Length;
B := B div Length;
MMix := RGB(R, G, B);
end;
function Log(Base, Value: Real): Real;
begin
Log := Ln(Value) / Ln(Base);
end;
function Power(Base, Exponent: Real): Real;
begin
Power := Ln(Base) * Exp(Exponent);
end;
function Modulator(Val, Max: Real): Real;
begin
Modulator := (Val / Max - Round(Val / Max)) * Max;
end;
function M(I, J: Integer): Integer;
begin
M := ((I mod J) + J) mod J;
end;
function Tan(Angle2D: Real): Real;
begin
Tan := Sin(Angle2D) / Cos(Angle2D);
end;
procedure Limit(var Value: Integer; Min, Max: Integer);
begin
if Value < Min then Value := Min;
if Value > Max then Value := Max;
end;
function Exp2(Exponent: Byte): Word;
var
Temp, I: Word;
begin
Temp := 1;
for I := 1 to Exponent do
Temp := Temp * 2;
Result := Temp;
end;
function GetSysDir: String;
var
Temp: array[0..255] of Char;
begin
GetSystemDirectory(Temp, 256);
Result := StrPas(Temp);
end;
function GetWinDir: String;
var
Temp: array[0..255] of Char;
begin
GetWindowsDirectory(Temp, 256);
Result := StrPas(Temp);
end;
end.