How to verify the color of a line

Can anyone please help me to be verify the colour of the line for ex , In this image there is a underline under color and UiPath in blue color so how we identify this color through UiPath ?

Hi @sauravx.giri

Try this

  1. Use Get Pixel Color activity
    Indicate a point on the blue underline

  2. Output → colorVar (type: System.Drawing.Color)

3 Compare the color value

Cheers

Can you tell me in which dependency this activity is present. Also can you share screenshot of that activity?

Hi @sauravx.giri

You can try UiAutomation in that use get attribute activity and select the attribute in which the color name is present.

Cheers

@sauravx.giri

Generally CSS is what has colour details…there are marketplace components which can help you get those details

cheers

This is a good approach. If your page has only text (without icons), there is a high possibility that the style property will contain the color.

If you know the position of your text, then you can try to get the color based on the coordinates. Please check this post:

The only other way is to use custom libraries.

1 Like

But how we indicate on the screen

Get pixel activity is not present in my activity list can we add additional dependencies for it

can you please elaborate more clear for me with screenshot because this way i got no output.

@sauravx.giri

is it a web app?

if yes then each element can be indicated

if not webapp then mostly you might be able to get the color as well

cheers

Here I can’t provide screenshots as of now, but you can use get attribute activity and check in which attribute you’re getting color by opening the uiexplorer then use that attribute into the get attribute activity to get the color name output.

@sauravx.giri

The base question what is the application? Is it desktop or web application or going to get image etc.
More the clarity to your question, more the chances of getting the answer.

We are using in web application

yes we are using in web application

@sauravx.giri

then what is the problem in indicating it

cheers

Hi @sauravx.giri,

For a web application, use Get Attribute on the element and read the CSS style such as color or text-decoration-color to get the exact RGB or HEX value. This is more stable than using pixel color, which can change with zoom or resolution.

@sauravx.giri

Use UiExplorer and there would be a property for it. If not then it must be in the css. Get the CSS using Get Attribute and then inside it there will be a property for colour.