# Scripts w/ dark mode feature

**URL:** <https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468>\
**Category:** Ignition\
**Created:** [October 18, 2024, 3:24pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468 "2024-10-18T15:24:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Domingues](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Rodrigo\_Domingues](https://forum.inductiveautomation.com/u/Rodrigo_Domingues)\
**Post date:** [October 18, 2024, 3:24pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/1 "2024-10-18T15:24:28Z")

</div>

Hi there,

I was wondering if IA has plans to insert dark mode features on ignition designer the same way it did with its online manual? I understand that for graphics and design can be a little 'weird' but maybe... on the scripts editor? 👉 👈

---

<div class="post-metadata">

**Author:** ![Tomas\_Ribeiro](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@Tomas\_Ribeiro](https://forum.inductiveautomation.com/u/Tomas_Ribeiro)\
**Post date:** [October 18, 2024, 3:33pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/2 "2024-10-18T15:33:29Z")

</div>

Totally agree!!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 18, 2024, 3:47pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/3 "2024-10-18T15:47:13Z")

</div>

It seems as though you are both hipsters. See here:

> [@Dark Mode Ignition? Eye Strain](https://forum.inductiveautomation.com/t/dark-mode-ignition-eye-strain/97405/2):
>
> Eye strain is much worse, long term, with dark mode. (If you know anything about depth of field in optics, and what your pupil does, it is no shock.) Fix your room lighting if light mode bothers your eyes. Long topic: Some young developers have worked out some hacks recently, so they can destroy their eyes faster. I'm not going to help you find it. Dark mode is the hipster thing, but you will regret it.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2024, 4:07pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/4 "2024-10-18T16:07:36Z")

</div>

If I remember correctly, the script editor used to have dark mode. You would right click in the pane and change the appearance.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [October 18, 2024, 4:14pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/5 "2024-10-18T16:14:05Z")

</div>

Every day I see the Dark Mode legion geting stronger as now there are even rumors of a wizard among them able to hack the darkness into existence

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 22, 2024, 9:08pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/6 "2024-10-22T21:08:30Z")

</div>

> [@dkhayes117](#):
>
> the script editor used to have dark mode

When I was initially developing [my own flavor of dark mode](https://forum.inductiveautomation.com/t/request-ignition-8-1-dark-theme-designer/33832/4) for the designer, I wrote this fun little script for comparing colors in the script console:

```python
from java.awt import Window
from java.beans import PropertyChangeListener

class PythonTextAreaBackgroundListener(PropertyChangeListener):
	def __init__ (self, color):
		self.color = color
	
	def propertyChange(self, event):
		if event.propertyName == "background":
			event.source.background = self.color
		

def exploreWindow(window):
	for component in window.components:
		componentClass = component. __class__. __name__
		if componentClass == 'PythonTextArea$textArea$1':
			for listener in component.propertyChangeListeners:
				if listener. __class__. __name__ == 'PythonTextAreaBackgroundListener':
					component.removePropertyChangeListener(listener)
					break
					
			if hasattr(listener, 'color') and listener.color == currentBackgroundPick:
				component.addPropertyChangeListener(PythonTextAreaBackgroundListener(comparisonBackgroundColor))
				component.background = comparisonBackgroundColor
				component.foreground = comparisonforegroundColor
				component.currentLineHighlightColor = comparisonHighlightColor
			else:
				component.addPropertyChangeListener(PythonTextAreaBackgroundListener(currentBackgroundPick))
				component.background = currentBackgroundPick
				component.foreground = currentForegroundPick
				component.currentLineHighlightColor = currentHighlighterPick
					
		exploreWindow(component)
		
currentBackgroundPick = system.gui.color('silver')
currentForegroundPick = system.gui.color('black')
currentHighlighterPick = system.gui.color(255, 255, 160)

comparisonBackgroundColor = system.gui.color('pink')
comparisonforegroundColor = system.gui.color('orange')
comparisonHighlightColor = system.gui.color(255, 255, 160)

for window in Window.getWindows():
	if window.visible and window. __class__. __name__ == 'InteractiveScriptPlayground':
		exploreWindow(window)

```

Simply paste the script into the script console, change the `system.gui.color` parameters, and run the script to toggle back and forth between background, foreground, and highlight colors in the console for purposes of comparison:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54b47a3875751640057c436882c2ea39f626488c.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/31a71b6fdd54c41fac7724f84277104118293c9a.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c022ecb5c27c65ad8209b2ffac9836e20e417ac.png)

This is the one I ended up using for late night "dark mode" scripting:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/a/2a9862c2f4fdca3e37114f5e074b4b8ef2b5cc10.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2babc8ff5dbcdd4cedd01c50da575751d93a39e4.png)

It's still a positive polarity, which makes everything easier to read, but it's not blindingly bright, so I imagine my melatonin production is not completely inhibited while I'm staying up later than I should to play around with some abstract idea that popped into my head after hours.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 22, 2024, 10:20pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/7 "2024-10-22T22:20:49Z")

</div>

> [@justinedwards.jle](#):
>
> This is the one I ended up using for late night "dark mode" scripting:

Psst, if you're going to do this anyways, take a look at the [`NamedTheme`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.43/com/inductiveautomation/ignition/common/gui/NamedTheme.html) class, which has some built-in RSyntaxTextArea themes.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 23, 2024, 12:43am UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/8 "2024-10-23T00:43:23Z")

</div>

> [@paul-griffith](#):
>
> RSyntaxTextArea

I remember back when I was messing with this, I was able to find the source code for the RSyntaxTextArea online, and that helped out a bunch

There's more to it than simply inverting colors. Listeners are needed to detect when the designer opens or adds things, and the enabled and disabled button icons have to be reversed to get the contrast right with a dark theme. A lot of the OEM listeners have to be wrapped, so they can still perform their functions without messing up the color scheme, and so they can be put back to normal when the user switches back to light mode.

A few months ago, I developed a working prototype, but then I got super busy with actual work, and consequently, I stopped messing around with it. Now that 8.3 is about to come out, I'm not sure it's worth delving back into.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 27, 2024, 3:49am UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/9 "2024-10-27T03:49:08Z")

</div>

> [@paul-griffith](#):
>
> take a look at the [`NamedTheme`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.43/com/inductiveautomation/ignition/common/gui/NamedTheme.html) class

Just for the edification of anybody interested in this thread. Here is an example of how to apply the Dark NamedTheme to the script console's text area using Jython:

```python
from java.awt import Window
from com.inductiveautomation.ignition.common.gui import NamedTheme

# To reverse this, simply use NamedTheme.Default.theme
def applyDarkTheme(window):
	for component in window.components:
		if component. __class__. __name__ == 'PythonTextArea$textArea$1':
			theme = NamedTheme.Dark.theme
			theme.apply(component)
		applyDarkTheme(component)

for window in Window.getWindows():
	if window.visible and window. __class__. __name__ == 'InteractiveScriptPlayground':
		applyDarkTheme(window.rootPane)

```

**Result:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/865d2ce63adfacca4d4cefdee063f3c2f46fc16b.png)

...or more generically for use on any jython text area, the function would look like this:

```python
from com.inductiveautomation.ignition.common.gui import NamedTheme

# To reverse this, simply use NamedTheme.Default.theme
def applyScriptEditorDarkTheme(jythonTextArea):
	theme = NamedTheme.Dark.theme
	theme.apply(jythonTextArea)

```

**Edit:**  
@Rodrigo_Domingues @Tomas_Ribeiro  
A Dark Mode patch is now available for download on the exchange:  
[Dark Mode for the Designer](https://inductiveautomation.com/exchange/2719/overview)

For the Vision module and the project library script editor, it's well polished. and it will darken the main of the windows in the Perspective and Reporting modules as well.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Domingues](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Rodrigo\_Domingues](https://forum.inductiveautomation.com/u/Rodrigo_Domingues)\
**Post date:** [June 24, 2025, 3:46pm UTC](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468/10 "2025-06-24T15:46:02Z")

</div>

Thanks for the headsup!
