Detect Color in Image Detection RPA Express

Currently, RPA Express does not support color image detection (cf Image detection accuracy - even higher!).

Attached is a custom action that can be used as workaround. This script returns the color under the mouse as (r,g,b,a) (int value between 0 and 255). You can easily change it to return the color at a desired location of the screen. What is left is to compare the color with the targeted one and to click on the object (regular mouse click) if the condition is fulfilled.

Hope it solves your issues :slight_smile:
getColorAtMousePos.txt (1.5 KB)

6 Likes

Wow @alasbleis Thank you!

The script is great! Works like a charm :grinning:

@alasbleis - fantastic script!

Can you share more info on the real use cases you are solving using it?

Sure. I can’t share any caption for privacy reason but here is the idea:
The bot connects to a desktop application and needs to extract specific lines from a table.
In the first column of the table, there is a circle filled in with a specific color (green if the stage concerning this line is finished, red otherwise).
The only way to know which line to extract is through this colored circle.

Therefore, it is compulsory to be able to detect a pattern (the circle) with the corresponding color (hence the script).

2 Likes

thanks a lot! Detecting component status is a very wide-spread issue.

Hi ,

Can you please explain me how to call this script? as this is java code we need to call this script in executegroovyscript right ? so that it runs on NODE instead of APP Server?

It is a custom script, just copy-paste this code in a custom action (in RPA express)

1 Like

Okay Thanks

1 Like