From e8b77a251487daabad64ae17c2255b4582c7e03f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Fri, 6 Dec 2019 23:49:33 +0100 Subject: [PATCH] Don't calculate sun colors when sun is completely up --- src/kaka/cakelight/mode/SunriseMode.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kaka/cakelight/mode/SunriseMode.java b/src/kaka/cakelight/mode/SunriseMode.java index 896646f..b0840c9 100644 --- a/src/kaka/cakelight/mode/SunriseMode.java +++ b/src/kaka/cakelight/mode/SunriseMode.java @@ -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; -- 2.11.0