[issue33289] tkinter askcolor returning floats for r, g, b values instead of ints
Serhiy Storchaka
report at bugs.python.org
Sat Apr 21 03:35:56 EDT 2018
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
Good catch! A color tuple will likely be used in '#%02x%02x%02x' % color, and this will fail because %x works only with integers (in general sense). Therefore returning a tuple of floats is a bug.
The downside is that we loss some information. Tk supports up to 16 bit per color component, and askcolor() keeps only higher 8 of them. This can't be changed for backward compatibility, but it may be worth to add an option for control the representation of the result. winfo_rgb() returns 16-bit color components. This is a separate issue.
----------
keywords: +easy
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33289>
_______________________________________
More information about the Python-bugs-list
mailing list