You can import a ready-made example from here: https://eu.eyeauras.net/share/S20240223230313LBOJUBwnUmRU
var trigger = AuraTree.FindAuraByPath(@".\ColorSearch") // find the aura by name
.Triggers.Items // iterate through all triggers
.OfType<IColorSearchTrigger>() // find triggers of type "Color Search"
.First(); // take the first one; an error will occur if not found
var matchResult = trigger.Refresh(); // force the trigger to perform the search
if (matchResult.Detected.Success == false) {
// if not found, there is nothing more to do
Log.Warn("Colored area not found");
return;
}
// found the color, get the local (window) coordinates
var localRect = matchResult.Detected.Bounds.Value;
// convert to screen coordinates
var screenRect = matchResult.ToScreen(localRect);
Log.Info($"Colored area found @ {screenRect}");
Important! Note that in the color search trigger, the setting is to look for a colored rectangle:
Comparison Granularity = Average Color of 8x8 Pixel Blocks
.
By default,Color Search
averages the color of the entire selected region, which is not what we need.