Tk Source Code

View Ticket
Login
Ticket UUID: 5b06d8b94ab0d27ca9a391d48ea627a9e5090985
Title: Wrong RGB values for systemDisabledControlTextColor
Type: Bug Version: all
Submitter: nemethi Created on: 2026-01-15 17:41:30
Subsystem: 66. Aqua Window Operations Assigned To: marc_culler
Priority: 5 Medium Severity: Severe
Status: Open Last Modified: 2026-09-29 16:26:50
Resolution: None Closed By: nobody
    Closed on:
Description:

Run the following script on macOS 26 (Tahoe):

. configure -background systemDisabledControlTextColor
puts [winfo rgb . systemDisabledControlTextColor]

I have executed this script with Tk 8.6.10, 8.6.11, 8.6.12, 8.6.13, 8.6.15, 9.0.1, and 9.1a1 (trunk).  With all these Tk versions, the main window . is displayed in a gray color (#b2b2b2), but the output is  "0 0 0".  Obviously, this is wrong.

In addition, with Tk 9.0.1 and 9.1a1 only, if the window is moved away from its initial position then its color changes to almost black (e.g, #040404 or #020202).

Same bogus behavior on macOS 10.15 (Catalina).

On macOS 10.13 (High Sierra) the script works as expected: the main window is displayed in the color #7f7f7f and the output is  "32767 32767 32767".

User Comments: serhiy.storchaka added on 2026-09-29 16:26:50:

Since macOS 10.14 disabledControlTextColor and some other semantic colors are not opaque. GetRGBA() keeps their alpha:

  • When drawing, a background in such a color is translucent black over the window background. It looks like #b2b2b2 at first, but in 9.x every redraw adds another layer, so it gets darker after the window is moved.
  • TkpGetColor() ignores alpha, so winfo rgb returns 0 0 0.

Tk colors are opaque, so a possible fix is to blend a translucent semantic color over the window background (for the same appearance) in GetRGBA(). Then drawing and winfo rgb would both give the color actually seen. I cannot test it, as I have no macOS.


nemethi (claiming to be Csaba Nemethi) added on 2026-01-16 17:13:34:

"indent" -> "intend", sorry!


nemethi (claiming to be Csaba Nemethi) added on 2026-01-16 10:00:19:

Christopher, many thanks for your comment!  I don't indent to use systemDisabledControlTextColor as a background color (in the enhanced treeview it is currently used as the foreground color of the column headings).  But is is very annoying that its RGB values are the ones corresponding to black, although the texts having it as foreground color appear in #b2b2b2 (which is very close to the gray70 color).


chrstphrchvz added on 2026-01-15 21:46:12:

Some semantic colors such as systemDisabledControlTextColor are not opaque, and are likely not meant for use as background colors. See https://github.com/bohagan1/TkTable/issues/5#issuecomment-3261955322