How to read color

Best practices, code snippets for common functionality, examples, and guidelines.
IvanT
Posts: 51
Joined: Wed Feb 06, 2019 8:00 pm

How to read color

Post by IvanT » Sun Nov 29, 2020 9:56 pm

In snapshot i have a lot of colors, but i can't read them. May be ranorex has some plugin to read it?
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to read color

Post by odklizec » Mon Nov 30, 2020 7:19 am

Hi,

I'm afraid, you are out of luck here. Apparently, this kind of system color panel is not accessible by Ranorex Spy or any other UI spy tool.
Colors.png
You will get the same result from MS Inspect, which means that this UI element is apparently not implemented with accessibility on mind. So no, you can't get the individual colors by Ranorex tools. The only thing you may probably do is to use image-based automation eventually, implement your own color reading method via C#?
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: How to read color

Post by Stub » Mon Dec 07, 2020 9:29 am

That last is what I've had to do for some stuff in our AUT. I grab a bitmap of the element and study the pixel colour at the centre, or something along those lines. Has worked reliably for us for years now.