Don't calculate sun colors when sun is completely up
authorTomas Wenström <tomas.wenstrom@gmail.com>
Fri, 6 Dec 2019 22:49:33 +0000 (23:49 +0100)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Fri, 6 Dec 2019 22:49:33 +0000 (23:49 +0100)
src/kaka/cakelight/mode/SunriseMode.java

index 896646f..b0840c9 100644 (file)
@@ -12,6 +12,10 @@ public class SunriseMode extends AmbientMode {
 
     @Override
     protected void updateFrame(LedFrame frame, long time, int count) {
+        if (time > durationSeconds) {
+            frame.fillColor(Color.rgb(255, 255, 255));
+            return;
+        }
         double progress = clamp(time / (durationSeconds * 1000.0));
         double elevation = 2.0 - progress;
         double radius = progress * 2.12;