- public void lightDeadStrip(Strip strip, Integer index) {
- float strip_dist = LXUtils.wrapdistf((float) index, stripPos.getValuef(), model.strips.size());
- float dist_proportion = (strip_dist / (float) model.strips.size());
- float hv = dist_proportion * 360;
- float dead_bright = deadParameter.getValuef() * dist_proportion;
+ public void lightDeadStrip(Strip strip, StripState strip_state, double deltaMs) {
+ float strip_dist = LXUtils.wrapdistf((float) strip_state.index, stripPos.getValuef(), model.strips.size());
+ float hv = (strip_dist / model.strips.size()) * 360;
+ float bv = strip_state.current_brightness;
+
+ if(!strip_state.just_changed || deltaMs >= rateParameter.getValuef()) {
+ float bright_prop = 1.0 - min(((float) time_since_last_run / rateParameter.getValuef()), 1.0);
+ bv = max(0.0, bright_prop * MAX_ALIVE_BRIGHTNESS);
+
+ if(strip_state.current_brightness > bv) {
+ strip_state.current_brightness = bv;
+ } else {
+ bv = strip_state.current_brightness;
+ }
+ }