Using Delphi 10.2 and themes: is there a reliable way to determine if the current theme is a "light" (white or light clWindow color) or "dark" (black, near-black or dark clWindow color) theme? I have to paint certain elements in specific colors (e.g. an alarm indicator in red, regardless of the theme color) but need to use "bright" red against a dark background vs a more "muted" red against a light background.
I've tried looking at various sets of the RGB components of the theme's clWindow color (i.e. if 2 of the 3 component colors are > $7F, it's a "light" theme) but that's not always reliable for some themes.
Is there a better/more reliable way to determine this?