@property\r
def name(self):\r
foundName=RGBToNames.get(self,None)\r
- if not foundName:\r
- closestRGB=sorted(RGBToNames.iterkeys(),key=lambda x: math.sqrt((abs(self.red-x.red)*0.3)**2+(abs(self.green-x.green)*0.59)**2+(abs(self.blue-x.blue)*0.11)**2))[0]\r
- foundName=RGBToNames[closestRGB]\r
- RGBToNames[self]=foundName\r
- return foundName\r
+ if foundName:\r
+ return foundName\r
+ foundName=RGBToNamesCache.get(self,None)\r
+ if foundName:\r
+ return foundName\r
+ longestDistance=255.0\r
+ closestName=_("unknown color")\r
+ for possibleRGB,possibleName in RGBToNames.iteritems():\r
+ distance=math.sqrt(abs(self.red-possibleRGB.red)**2+abs(self.green-possibleRGB.green)**2+abs(self.blue-possibleRGB.blue)**2)\r
+ if distance<longestDistance:\r
+ longestDistance=distance\r
+ closestName=possibleName\r
+ RGBToNamesCache[self]=closestName\r
+ return closestName\r
+\r
+RGBToNamesCache={}\r
\r
RGBToNames={\r
#Standard 16 HTML 4 colors\r
- NVDA is now able to read the recipiants in the To, CC and BCC fields in Microsoft Outlook. (#421)\r
- Fixed the issue in NVDA's Voice Settings dialog where the value of sliders was sometimes not reported when changed. (#1411)\r
- NVDA no longer fails to announce the new cell when moving in an Excel spreadsheet after cutting and pasting. (#1567)\r
-\r
+- NVDA no longer becomes worse at guessing color names the more colors it announces.\r
+ \r
\r
== Changes for Developers ==\r
- Developer documentation can now be generated using SCons. See readme.txt at the root of the source distribution for details, including associated dependencies.\r