]> git.dolda2000.com Git - kaka/cakelight.git/commitdiff
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 896646f39d56153adf9222193afd0394729bcd4c..b0840c9dd29ae8cabf03e4ec121173b82a4e8875 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;