This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE themes for light on dark
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: Anand Krishnakumar, jayseye, kbk, markroseman, python-dev, roger.serwy, terry.reedy
Priority: normal Keywords: patch

Created on 2015-08-07 04:54 by markroseman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
config-highlight.cfg markroseman, 2015-09-24 22:19
idle-dark.cfg terry.reedy, 2015-09-30 23:36
breakpoint-prefs.patch markroseman, 2015-10-01 00:10
Messages (22)
msg248177 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-07 04:54
If there are going to be highlighting themes in IDLE, and the ability to customize them, why not the background color of the window? Light on dark is easier for some people to read - adding one that did that would be a good candidate for another built-in theme. Also many people (myself included) tend to use a light color other than white for editors, terminals, etc.
msg248220 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-07 19:43
This looks like mostly a duplicate of #7949.  Can you differentiate?
msg248225 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-07 20:14
I read #7949 as saying the text widget picks up the background color from the system-wide GTk theme. 

This one is saying that the background color of the text widget should be changeable as part of an IDLE highlighting theme.
msg251550 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-24 22:19
I wrote a short utility that parses TextMate XML-based theme files (which are also used by Sublime) and converts them into something IDLE can use. It's not a perfect match, because IDLE's themes are more restrictive, but it's not bad.

I'm attaching the output of the script (config-highlight.cfg), which was able to translate 17 themes. A few are kind of yucky, and they all need some tweaking for selection and shell colors, but it's not a bad place to start...
msg251563 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-25 02:15
I re-read #7949 and read the problem as mixing a hard-coded (by tk or Idle is not clear) background (white) with a system-default foreground, which is also white when the system background is black.  Hence the screenshot in duplicate #16984.  In any case, that issue is complementary to this one, about user-configured tagged text colors.

Parsing an existing format is an interesting idea.  Most of the variations seem pointless, but I like the cobalt one as a basis for a dark theme.  I plan to improve it, using current Idle (Classic and New seem the same, so why two?), with my changes.  I will upload when I have something I like.

The change I made is to color the backgrounds of 'shell', 'stdout', and 'stderr' light yellow, light blue, and light red.  These changes work so well for me, at least, that I have thought of adding them to an 'Idle New' that is really new and different.  But transitions are hard.  The main other thing I don't like in 'Idle ???' is the orange for keywords, as too 'different' from the purple and blue of builtings and defined. But green is semi standard for strings and that does not leave room for three colors on the blue side.
msg251588 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-25 16:06
Sounds good. I agree picking a few and tweaking them would be a good way forward (and incidentally, the 'Cobalt' theme is the one I use in my regular editor!)
msg251607 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-25 20:19
For me, Idle comes with one light theme, under 2 names. I don't know what happens on Mac.  Let us add one dark theme as Idle Dark, before 3.4.4 if possible.

We can later consider whether to add more light and dark built-in themes. But I think more important would be to add the ability to change at once the background of all elements that use the default (normal) background. I believe you have mentioned that one might want to change white to an off-white.  Cobalt is an off-black, but someone might prefer black black, or the slightly bluer background of Windows Power Shell.  We should not have multiple themes just for background variations.
msg251614 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-25 21:20
Ok, do you want to add the dark theme in then?  I'll add some code to the ttk based preferences dialog (for when that gets in) to give the user the option of applying the new background color to all the other elements which had the same original background color.
msg251621 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-25 23:14
Here is an Idle Dark theme that is the near-inverse of the standard Idle theme, with foreground colors tweaked just a bit to account for the background switch and its blue tint.  It otherwise retains the current color mapping.  What do you think?
msg251624 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-25 23:59
Looks good to me!
msg251645 - (view) Author: Anand Krishnakumar (Anand Krishnakumar) Date: 2015-09-26 12:11
I'm a 14 year old who wants to start developing for Python. I absolutely adore this enhancement and I would love to contribute towards this.
So please let me know if I can help, and if yes, how?
msg251646 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-26 12:54
My only question right now is whether I should apply as is or with minor adjustments.  Thanks for the encouragements either way.
msg251970 - (view) Author: Marc Paul Rubin (jayseye) Date: 2015-09-30 20:57
Greetings from an idle-dev 'lurker.' Has anyone tested the new dark
theme with a Set Breakpoint command? The dark theme is great for me
except for this quirk: breakpoints are invisible on my test box. Under
the Classic light scheme breakpoints appear on a bright yellow 
Appreciate all the interest and work going into idle these days. I'll
add any needed details on request. For starters I'm just wondering
whether breakpoints have yet to be tested with this dark theme.
jayseye (Marc Paul Rubin)
msg251975 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-30 22:47
Hi Marc, you're correct that is an error in the theme. To correct it, change the setting for 'break-background' to be something like #666622. Thanks!
msg251979 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-30 23:36
Marc, thanks for unlurking.  I like something a bit brighter, such as #808000, though it does not matter much in this color area.  We are revising the highlight tab and should add a line [     breakpoint     ] to the sample box.
msg251981 - (view) Author: Mark Roseman (markroseman) * Date: 2015-10-01 00:10
Attached a patch to the current config dialog to add breakpoint to the window, and have updated the same thing in my newer dialog.
msg252186 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-03 02:13
New changeset e67da755d614 by Terry Jan Reedy in branch '2.7':
Issue #24820: Users can now set breakpoint colors in Settings ->

New changeset d874a6157223 by Terry Jan Reedy in branch '3.4':
Issue #24820: Users can now set breakpoint colors in Settings ->
msg252187 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-03 02:23
I was going to push both a version of the breakpoint patch and the new theme, but noticed a problem.  If someone selects IDLE Dark and saves that choice and then run an older Python+IDLE, then the older IDLE will not find 'IDLE Dark' and will run a backup default black and white theme, possibly with some error messages.  The solution is to select IDLE Dark and then immediately hit [Save as New Custom Theme] and enter a different name.  IDLE will then change Select: from (o) a Built-in Theme to (o) a Custom Theme, with the saved name selected.  I want to add a popup to say this before adding the theme.
msg252255 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-04 04:32
New changeset afa95f032de1 by Terry Jan Reedy in branch '2.7':
Issue #24820: Add 'IDLE Dark' text color theme, warning, and solution.

New changeset 1de01a63f360 by Terry Jan Reedy in branch '3.4':
Issue #24820: Add 'IDLE Dark' text color theme, warning, and solution.
msg252256 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-04 04:45
See patch for message.  Merely displaying a message, and not trying to do anything fancy, like cancelling the selection, avoids any possible problem in interaction with other methods.  I leave it to users to decide if action is needed, and if so, whether to switch or save as custom.

Mark's original post had two issues.  The first, a dark background theme, is now committed and this issue closed.  Thanks for the push for something requested by others.  I am using it myself.  

The second, the ability to simultaneously change all default backgrounds, such as white to off-white, is or will be either a new issue or part of the highlight tab rewrite, #24781.
msg252259 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-04 05:20
New changeset 739cc9ca55cd by Terry Jan Reedy in branch '2.7':
Issue #24820: Update IDLE NEWS items.

New changeset 233974dfda03 by Terry Jan Reedy in branch '3.4':
Issue #24820: Update IDLE NEWS items.

New changeset 89a1e03b4639 by Terry Jan Reedy in branch '3.5':
Issue #24820: Update IDLE NEWS items.
msg252279 - (view) Author: Mark Roseman (markroseman) * Date: 2015-10-04 18:25
FYI, the change multiple backgrounds thing is in my working version for the new dialog. Added new issue #25313 to remind us that the warning message is something we'd love to get rid of in the future and as quickly as possible make it unnecessary if we add more new themes and/or new features in themes.
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 69008
2015-10-04 18:25:36markrosemansetmessages: + msg252279
2015-10-04 05:20:03python-devsetmessages: + msg252259
2015-10-04 04:46:00terry.reedysetstatus: open -> closed
messages: + msg252256

assignee: terry.reedy
resolution: fixed
stage: resolved
2015-10-04 04:32:07python-devsetmessages: + msg252255
2015-10-03 02:23:24terry.reedysetmessages: + msg252187
2015-10-03 02:13:24python-devsetnosy: + python-dev
messages: + msg252186
2015-10-01 00:10:18markrosemansetfiles: + breakpoint-prefs.patch
keywords: + patch
messages: + msg251981
2015-09-30 23:36:46terry.reedysetfiles: - idle-dark.cfg
2015-09-30 23:36:29terry.reedysetfiles: + idle-dark.cfg

messages: + msg251979
2015-09-30 22:47:48markrosemansetmessages: + msg251975
2015-09-30 20:57:45jayseyesetnosy: + jayseye
messages: + msg251970
2015-09-26 12:54:55terry.reedysetmessages: + msg251646
2015-09-26 12:11:55Anand Krishnakumarsetnosy: + Anand Krishnakumar
messages: + msg251645
2015-09-25 23:59:32markrosemansetmessages: + msg251624
2015-09-25 23:14:13terry.reedysetfiles: + idle-dark.cfg

messages: + msg251621
2015-09-25 21:20:04markrosemansetmessages: + msg251614
2015-09-25 20:19:52terry.reedysetmessages: + msg251607
versions: + Python 3.4
2015-09-25 16:06:18markrosemansetmessages: + msg251588
2015-09-25 02:15:11terry.reedysetmessages: + msg251563
2015-09-24 22:19:28markrosemansetfiles: + config-highlight.cfg

messages: + msg251550
2015-08-07 20:14:25markrosemansetmessages: + msg248225
2015-08-07 19:43:09terry.reedysetmessages: + msg248220
2015-08-07 04:54:17markrosemancreate