How to get the background Color name of an element | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos
10% May Month Discount Avail now

Selenium Training Forum

How to get the background Color name of an element

V
Vinay Krishna Post on 09/03/2019

Hello,

Is there any way to get the Color names of the back ground color of an element. I am able to retrieve colors in RGB and HEX forms but not able to convert that to Orange, Green or Blue color names.

I googled it and it says we need to have a list of color names -RGB values mapping and application RGB values needs to be compared with that list to get the color name. Is that the only option ?

 

Thanks

Vinay

D

Instructor

Demo Reply on 12/03/2019

You can look up on the internet, usually the first two characters denote part of Red, next two denote part of Green and the last two denote part of Blue

 

V
Vinay Krishna Reply on 13/03/2019

my query is can we convert the RGB or HEX to color names through coding ?

D

Instructor

Demo Reply on 14/03/2019

Please refer the page https://www.w3schools.com/colors/colors_converter.asp

V
Vinay Krishna Reply on 30/03/2019

thank you, this can be closed