1 package kaka.cakelight.mode;
3 import kaka.cakelight.Color;
4 import kaka.cakelight.Configuration;
5 import kaka.cakelight.LedFrame;
7 public class SmoothVideoMode extends VideoMode {
8 private LedFrame frame;
12 public void enter(Configuration config) {
14 frame = LedFrame.from(config);
15 ledCount = config.leds.getCount();
19 public void updateWithFrame(LedFrame frame) {
20 super.updateWithFrame(smooth(frame));
23 private LedFrame smooth(LedFrame f) {
24 for (int i = 0; i < ledCount; i++) {
25 Color c = frame.getLedColor(i).interpolate(f.getLedColor(i), 0.5);
26 frame.setLedColor(i, c);