Build plugin UI components compatible with light and dark modes


I'm developing a simple idea plug-in. In this plug-in, toolwindow will host my form. I want to know how to set colors for the form. For example, for a text, I want it to be displayed in blue under the light theme and yellow under the darula theme. How should I do it in a standardized way. In addition, I want to add some beautiful components on the idea in the form. Can you give me some help or guidance?


1 comment


  1. For defining your colors, use JBColor class which holds 2 colors (for light and dark themes).
  2. For images and icons, see
  3. If your components need more advanced logic based on the theme, you can use UIUtil.isUnderDarcula() to detect a dark theme.

Please sign in to leave a comment.