Terry J. Reedy <tjre...@udel.edu> added the comment:

In Paine's failing color test, the returned tuple is The returned tuple is 
(0x4a48, 0x3c27, 0x8c91) versus (0x4a4a, 0x3c3c, 0x8c91), which is to say, 
nearly correct.  Since the tested call is 
  self._getints(self.tk.call('winfo', 'rgb', self._w, color))
either ._getints is buggy on this particular system (seems very unlikely), or 
root.tk.call is doing something flakey on this particular system (ditto), or 
the result is entirely the responsibility of tcl/tk and the test is too severe, 
testing tk, not our _tkinter/tkinter.

The preceding assert, which passed, is
  self.assertEqual(rgb('#F0F'), (0xFFFF, 0x0000, 0xFFFF))
Since the should that the call basically works, is the more detailed test 
needed for testing tkinter?

I looked at the color man page.  It says "When fewer than 16 bits are provided 
for each color, they represent the most significant bits of the color, while 
the lower unfilled bits will be repeatedly replicated from the available higher 
bits. For example, #3a7 is the same as #3333aaaa7777." This is 4 bits to 16. It 
does not give an example for 8 or 12 to 16 and this might allow some wiggle 
room.

Other text indicates some fuzziness in exact colors. "Tk_AllocColorFromObj 
returns a pointer to an XColor structure; the structure indicates the exact 
intensities of the allocated color (which may differ slightly from those 
requested, depending on the limitations of the screen)"  Perhaps this 
screen-specific behavior is happening here. 

Also, "They allow colors to be shared whenever possible, so that colormap space 
is preserved, and they pick closest available colors when colormap space is 
exhausted. "  Could this happen here?

test_winfo_rgb has multiple asserts.  If this one is commented out, do the rest 
pass?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43139>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to