[Tkinter-discuss] Tkinter colours lighter on OS X

Michael O'Donnell michael.odonnell at uam.es
Wed Jan 28 15:03:06 CET 2015

Hi Patrick,

  I noted something similar in a post to this list in May 2013:


My GUI used a gif for borders, and I will with a colored canvas.
On the (then) new Macosx, the colors of the gif were different
from the canvas color.

...while on Windows or earlier versions of Macosx, the gif
and canvas merged seamlessly.

I received no response which fixed the problem.

My code now has special code to substitute color codes
if on a Mac running 10.9 or higher. Lots of work for
some stupid reason outside my control.

My guess it is Apple's fault, but may be due to
problems in the Mac port of Tk.

Because of problems like these, I am moving my code
base to an htm5 interface, on the rational that sheer
number of users will cause bugs to be ironed out quicker
(I have been using tk, and then tkinter, since 1995).


On 28 January 2015 at 08:20, Patrick Robertson
<robertson.patrick at gmail.com> wrote:
> I’m having a problem whereby every colour I declare in Tkinter (background
> colour, font colour etc.) is always a shade lighter when viewed on OS X.
> Take for example the test code:
> import Tkinter
> root = Tkinter.Tk()
> root.configure(bg="#000000")
> root.configure(borderwidth=20)
> root.geometry('%dx%d+%d+%d' % (200, 200, 200, 200))
> frame = Tkinter.Frame(root, bg="#444444", borderwidth=20)
> frame.pack(fill=Tkinter.BOTH)
> frame2 = Tkinter.Frame(frame, bg="#999999", height=120)
> frame2.pack(fill=Tkinter.BOTH)
> root.mainloop()
> If you run this on OS X and then open up DigitalColor Meter and hover over
> each box, you will see that the two lighter grey colours don't match what is
> in the code.
> If I hover over the the inner square, I get #A9A9A9 (instead of #999999),
> and the middle square gives #565656 (instead of #444444).
> I also get the same thing for .gifs I load using Tkinter.PhotoImage(data=…).
> For images I have tried changing the sRGB/RGB setting of the image to no
> avail
> I'm running OS X 10.9 with Python 2.7.8, Tc/Tk 8.5 (Tkinter specifies
> __version__ = '$Revision: 81008 $')
> Has anybody else experienced this problem, and if so what is the right fix?
> Thanks
> You can see the full question on SO:
> https://stackoverflow.com/questions/28166029/tkinter-colours-lighter-on-os-x
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss

More information about the Tkinter-discuss mailing list