   
   uint32_t colour()
   {
-    return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
+    if (timeStatus() == timeSet) {
+      const time_t t = now();
+      if (hour(t) >= 6 && hour(t) < 18) {
+        return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
+      }
+    }
+    
+    return Adafruit_NeoPixel::Color(brightness, 0, brightness);
   }
 };
 
 Adafruit_NeoPixel pixels(PIXEL_COUNT, PIXEL_PIN); 
 Button button(BUTTON_PIN);
 Nightlight nightlight;
-byte on = false;
-byte lastHeld = false;
 
 void setup()
 {

  pixels.show();
  button.setup();
  Serial.begin(9600);
  Serial.println("Hello");
}

void loop()
{
  button.read();
  
  if (button.pressed()) {
    on = !on;
    if (on) {
      Serial.println("Turning on");
      for (int i = 0; i != pixels.numPixels(); ++i) {
        pixels.setPixelColor(i, nightlight.colour());
      }
    } else {
      Serial.println("Turning off");
      pixels.clear();
    }
    pixels.show();
  }
  
  const byte held = button.held();

    }
  }
  
  const uint32_t colour = nightlight.colour();
  if (lastColour != colour) {
    for (int i = 0; i != pixels.numPixels(); ++i) {
        pixels.setPixelColor(i, colour);
    }
    pixels.show();
    lastColour = colour;
  }
  
  delay(10);
}

