Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TreeAC: Integer;
- var
- TPA: TPointArray;
- allCol, uniCol, colTal: TIntegerArray;
- CTS, i, ii, H1, H2, t: Integer;
- begin
- CTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- FindColorsSpiralTolerance(MMCX, MMCY, TPA, 2249277, MMX1, MMY1, MMX2, MMY2, 45);
- allCol := GetColors(TPA);
- uniCol := allCol;
- ClearSameIntegers(allCol);
- H1 := High(allCol);
- H2 := High(uniCol);
- SetLength(colTal, H2 + 1);
- for i := 0 to H1 do
- begin
- for ii := 0 to H2 do
- begin
- if allCol[i] = uniCol[ii] then
- Inc(colTal[ii]);
- end;
- end;
- t := 0;
- for i := 0 to H2 do
- if colTal[i] > colTal[t] then
- t := i;
- Result := uniCol[t];
- ColorToleranceSpeed(CTS);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement