Added a LED controller that consumes LED frames from the modes
[kaka/cakelight.git] / src / kaka / cakelight / LedFrame.java
diff --git a/src/kaka/cakelight/LedFrame.java b/src/kaka/cakelight/LedFrame.java
new file mode 100644 (file)
index 0000000..a4f6293
--- /dev/null
@@ -0,0 +1,21 @@
+package kaka.cakelight;
+
+import javafx.scene.paint.Color;
+
+public class LedFrame {
+    private Color[] leds;
+
+    public static LedFrame from(Configuration config) {
+        LedFrame frame = new LedFrame();
+        frame.leds = new Color[config.leds.cols * 2 + config.leds.rows * 2];
+        return frame;
+    }
+
+    public void setLedColor(int led, Color color) {
+        leds[led] = color;
+    }
+
+    public Color getLedColor(int led) {
+        return leds[led];
+    }
+}