From Xojo Documentation
Indicates if the app is running in dark mode for the OS.
result = IsDarkMode
|result||Boolean||True if the app is running in dark mode and False if it is not.|
Currently this will only return True when running on macOS Mojave or later when dark mode is enabled in System Preferences and when Supports Dark Mode is set to ON in the project Shared Build Settings.