How to retrieve color properties of the current theme ?

Hello,

I have developped a graphical plugin. I use a custom JTable that has a white grid background. I woulk like to adapt the background color to the selected IntelliJ theme.
How do I get the current theme and its color properties ?

Thanks.
Olivier

2 comments
Comment actions Permalink

Hi Olivier,

You can obtain editor color scheme used at the moment via EditorColorsManager.getInstance().getGlobalScheme(). It has 'defaultForeground' and 'defaultBackground' properties.

As to LAF colors, there is an utility class which provides them - UIUtil.getXxxColor(), getXxxBackground() etc methods (e.g. UIUtil.getTableBackground()).

Denis

0
Comment actions Permalink

Thanks Denis, you helped me a lot after almost 10 years ;)

0

Please sign in to leave a comment.