         // caused a linker error due to NSVariableStatusItemLength changing to a CGFloat.
         statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
         
-        // Add the inital image to the statusItem.
+        // Create an action when the item is clicked.
+        statusItem.action = Selector("itemClicked:")
+        
+        // If the mac os x theme is currently light, use the light image.
         statusItem.image = NSImage(named: "Sunny")
         
-        // Create an action when the item is clicked.
-        statusItem.action = Selector("itemClicked:")
+        // Set image as a template in order for dark mode changes to take effect.
+        statusItem.image?.setTemplate(true)
     }
     
     /**

            // Change the statusItem image to include rays to
            // indicate that dont sleep mode is on.
            statusItem.image = NSImage(named: "SunnyRays")
        
            // Create the assertion that will prevent the application from sleeping.
            success = IOPMAssertionCreateWithName(kIOPMAssertPreventUserIdleDisplaySleep,
                                                  IOPMAssertionLevel(kIOPMAssertionLevelOn),

    
    /// Status for the assertion depicting the reason for the activity.
    var reasonForActivity = "DontSleep is on -- so don't sleep!" as CFString
    
    // MARK: Methods
    
    func applicationDidFinishLaunching(aNotification: NSNotification) {
