Hey guys jsut made this function Heres what it does.
SCAR Code:
{By Freakymonkey. This function use the variety of colors given and
tries to find them and save them into individual TPAs. Then it combines the TPAS into
one SINGLE TPA.
XX, YY; Point from where to start searching for colors
TPA : TPointArray in which all colors are saved
Colors: Colors that save into the TPAs
Tol: Tolerance
X1, Y1, X2, Y2: Area in which to find the colors
Results Boolean }
function AddTPAS(XX, YY: Integer; TPA: TPointArray; Colors: TIntegerArray; Tol, X1, Y1, X2, Y2: Integer): Boolean;
however, it compiles but when it combines the TPAs and then ends the function the Length of the combined TPA is 0! Here is the whole script, plz help me 
SCAR Code:
function AddTPAS(XX, YY: Integer; TPA: TPointArray; Colors: TIntegerArray; Tol, X1, Y1, X2, Y2: Integer): Boolean;
Var v, c: Integer;
Var TPAS: T2DPointArray;
begin
Result := False;
if Length(Colors) < 0 then Exit;
SetArrayLength(TPAS, Length(Colors));
for v := 0 to High(TPAS) -1 do
FindColorsSpiralTolerance(XX, YY, TPAS[v], Colors[v], X1, Y1, X2, Y2, Tol);
TPA := CombineTPA(TPAS[0], TPAS[1]);
if Length(COlors) = 2 then
begin
Result := True;
Exit;
end;
for v := 2 to High(TPAS) - 1 do
TPA := CombineTPA(TPA, TPAS[v]);
Result := True;
end;
I'm sure there mgith be another function out there like this but I would REALLy like it if you guys could help me make this function work decently