The KMDARKMODE() function (v9.0+, OS X 10.14+) returns 1 if Keyboard Maestro is in Dark Mode (either explicitly, or because the system is), 0 otherwise.
The function will always return 0 in systems before OS X 10.14 Mojave.