JetBrains: Recognize dark vs light theme
Created by: vdavid
Problem
Our search box doesn't display right:

The problem is that it needs a top-level class of either dark-theme
or light-theme
to display right.
Solution
There is no dark/light theme setting in IntelliJ, just one can download themes and that's it. However, after doing some research in the theme marketplace, it shows that all themes use either use a light or a dark background for the editor. (They need to display legible text, after all.) So, a good solution seems to be to request the editor background color from the theme, and set the class dynamically based on that. For determining light vs dark, the HSP (Highly Sensitive Poo) equation from http://alienryderflex.com/hsp.html seems like a great solution.