Re: [orca-list] Color name support just added to Orca master



Hello,
If you would like to review this you may like to check the function
rgbToName(red, green, blue)
In the following file: https://git.gnome.org/browse/orca/plain/src/orca/colornames.py

On 13.05.2014 23:36, ryunoki openmailbox org wrote:
Hello, Christopher and Joanie,

as Mathematician I would say it's a matter of defining the "right"
distance function.
Joanie, can you point me to the file, where you determined the nearest
match? Maybe I can have a look at it.

Regards, André

Am 11.05.2014 21:43, schrieb Joanmarie Diggs:
Hey Christopher.

All you have to do is convert the RGB values (which we get via AT-SPI2)
into hex and look them up. The only tricky part was finding the nearest
match when the color is not exactly one of the items in the table. I
googled and found an answer to that problem. (Problems are like plots:
There are no new ones. <smiles>) And then I tweaked that solution
because really dark and really light colors had nearest matches of black
and white respectively. The algorithm might need a bit more tweaking,
which is something we'll learn over time.

The real problem, however, is when applications (or more likely their
toolkits) fail to expose the correct RGB value to us. In the case of
Epiphany/WebKitGtk, I'm pretty sure the problem is that the colors of
parent nodes are not being taken into account when reporting colors to
us. And I have vague recollections of Alex Surkov (from Mozilla) solving
this problem for Gecko. In the case of Gtk+ apps and VTE, I'm pretty
sure there's not an inheritance/parent node problem, but a failure of
those toolkits to update the attributes exposed to us. But, again, soon
I'll look into that and file the necessary bugs so the developers of the
toolkits in question can fix them properly.

Take care.
--joanie

On 05/11/2014 10:44 AM, Christopher Chaltain wrote:
Wow, I'm curious how you did this. I gave it some thought a few years
ago, and I did find a table mapping RGB values to color names, but I
couldn't find an algorithm on line and I couldn't come up with one
myself. I didn't spend that much time on it though, and I'm not the
smartest guy in the world, so it doesn't surprise me that someone else
cracked this nut, but I am curious how you did it. Feel free to ignore
this question or respond to me privately if you don't want to discuss it
or take up any list traffic on it. I'm just curious.

_______________________________________________
orca-list mailing list
orca-list gnome org
https://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca.
The manual is at http://library.gnome.org/users/gnome-access-guide/nightly/ats-2.html
The FAQ is at http://live.gnome.org/Orca/FrequentlyAskedQuestions
Log bugs and feature requests at http://bugzilla.gnome.org
Find out how to help at http://live.gnome.org/Orca/HowCanIHelp



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]