Don't think there's a cocoa way of detecting it yet, however you can use defaults read
to check whether or not OSX is in dark mode.
defaults read -g AppleInterfaceStyle
Either returns Dark
(dark mode) or returns domain pair does not exist.
EDIT:
As Ken Thomases said you can access .GlobalPreferences via NSUserDefaults, so
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
If osxMode is nil
then it isn't in dark mode, but if osxMode is @"Dark"
then it is in dark mode.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…