Color ===== The Color include contains all Colorfinding routines. .. note:: Remove?: - FindDeformed - DTMRotated - GetColorsBox? FindDeformed ~~~~~~~~~~~~ .. code-block:: pascal function FindDeformed(var Xoff, Yoff: Integer; BMP, a, b, c, d: Integer): Boolean; Finds Bitmap in Box a,b,c,d. Returns coords in ObjX and ObjY. Uses Deformed Bitmap. FindDeformed will gradually lower Tol and reduce Accuracy. Functon can cause severe Lag when using bitmaps bigger then 16 pixels. Works but Lags. Useful for MM-clicking. For ObjectFinding use FindObjectDeformed. .. note:: by WT-Fakawi Example: .. code-block:: pascal FindColorsPie ~~~~~~~~~~~~~ .. code-block:: pascal function FindColorsPie(var Points: TPointArray; Color, Tol: Integer; StartD, EndD, MinR, MaxR: Extended; x1, y1, x2, y2, Mx, My: Integer): Boolean; Finds all Colors with tolerance in the Pie, defined by x1, y1, x2, y2, Mx, My, StartDegree, EndDegree, MinRadius and MaxRadius. .. note:: by Wizzup?, edit by EvilChicken! Example: .. code-block:: pascal DTMRotated ~~~~~~~~~~ .. code-block:: pascal function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean; First looks for a DTM without rotation, then increases the amount of rotation around 0 gradually until it finds the DTM. A bit like the ProgressiveTol Bitmap Engines. .. note:: by Yakman Example: .. code-block:: pascal GetColorsBox ~~~~~~~~~~~~~ .. code-block:: pascal function GetColorsBox(x1, y1, x2, y2: Integer; ClearSameColors: Boolean): TIntegerArray; Returns an array of all colors within box ((x1, y1), (x2, y2)). If ClearSameColors is set to True, all duplicate colors will be deleted. .. note:: by Rasta Magician Example: .. code-block:: pascal PercentColorMMEx ~~~~~~~~~~~~~~~~ .. code-block:: pascal function PercentColorMMEx(Color, Tol, StartRadial, EndRadial, StartRadius, EndRadius: Integer): integer; Returns the percentage of colour on the minimap section defined by StartRadial, EndRadial, StartRadius, and EndRadius. .. note:: by Richard, and Nava2 Example: .. code-block:: pascal PercentColorMM ~~~~~~~~~~~~~~ .. code-block:: pascal function PercentColorMM(Color, Tol: Integer): Integer; Returns the percent of a colour on the whole minimap. .. note:: by Richard Example: .. code-block:: pascal FindMMColorsTolerance ~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function FindMMColorsTolerance(var Points: TPointArray; Color, Tol: Integer): Boolean; Finds all colors within "Tol" tolerance in the minimap circle and if successful, returns a TPointArray containing them, sorted from MMCX, MMCY. .. note:: by EvilChicken! Example: .. code-block:: pascal GetColorArrayInfo ~~~~~~~~~~~~~~~~~ .. code-block:: pascal function GetColorArrayInfo(C: TIntegerArray; var BestColors, Tolerances: TIntegerArray; Speed2Mods: TExtendedArray; var RGB: array of TIntegerArray; var HSL, XYZ: array of TExtendedArray): array of array of TExtendedArray; Takes an array of colours and outputs a multitude of information - BestColors - An array of the best color to find per CTS Speed, the array index is relative to the CTS - 1. AKA BestColors[2] returns the best color for ColorToleranceSpeed 3. - Tolerances - An array of the necessary tolerance to find all of the colours with array index is the CTS. Tolerances[1] = CTS 1. - Speed2Mods - [0]is Hue modifier, [1] is Saturation. RGB, HSL, XYZ: Arrays which hold the RGB, HSL, and XYZ values respectively. - The Result - The result array is divided like so - Result[CTS][Div][MMA] - CTS - The colour tolerance speed - 1. 0 and 1 are combined since they both use RGB. - Div - The division, for exampe HSL, H is index 0, S is index 1, and L is index 2. - MMA - The last values are the Minimum, Maximum, and average of the colors. .. note:: by Nava2 Example: .. code-block:: pascal GetBestColor ~~~~~~~~~~~~ .. code-block:: pascal function GetBestColor(Colors: TIntegerArray; CTS: Integer; var Tol: Integer; var Speed2Modifiers: TExtendedArray): Integer; Gets the best colour to find as well as the tolerance and modifiers based on which CTS you input. .. note:: by Nava2 Example: .. code-block:: pascal CreateAutoColorInfo ~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function CreateAutoColorInfo(Colors: TIntegerArray): TAutoColorInfo; Creates a TAutoColorInfo from the inputted array of colors. .. note:: by Nava2 Example: .. code-block:: pascal