# 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:** 1\
**Showing post:** 6

<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.

---

_[View the full topic](https://forum.inductiveautomation.com/t/scripts-w-dark-mode-feature/97468)._
