How to implement editors for specific themes (e.g. Darcula)?
Hi,
I want to develop an editor that reacts differently based on the selected UI theme.
How can I determine which UI theme is currently selected?
I plan on defining a specific stylesheet where the background and font colors are determined based on the UI theme.
Best regards!
Please sign in to leave a comment.
I'm currently using something like this to detect the Darcula mode:
You can also return an instance of JBColor from any code (query) that should return a java.awt.Color. JBColor constructor takes two colors, light and dark, and will choose between them depending on the active theme.
In addition, style attributes taking a color allow specifying two colors directly as a light/dark pair.
Thank you, I will definitely try that!