Rename noise mode
authorTomas Wenström <tomas.wenstrom@gmail.com>
Mon, 14 Jun 2021 18:07:31 +0000 (20:07 +0200)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Mon, 14 Jun 2021 19:16:03 +0000 (21:16 +0200)
src/kaka/cakelight/Commands.java
src/kaka/cakelight/Console.java
src/kaka/cakelight/mode/NoiseMode.java [moved from src/kaka/cakelight/mode/TwoColorNoiseMode.java with 77% similarity]

index cbd9e38..e665cf1 100644 (file)
@@ -155,15 +155,13 @@ class Commands {
        });
     }
 
-    static Console.Command twoColorNoiseMode() {
+    static Console.Command noiseMode() {
         return modeCommand(new String[] {"n", "noise"}, (console, args) -> {
            if (args.length > 1) {
                console.out("setting multi-color noise mode");
-               return new TwoColorNoiseMode(Stream.of(args)
-                                            .map(arg -> console.parseColor(arg))
+               return new NoiseMode(Stream.of(args)
+                                            .map(console::parseColor)
                                             .toArray(Color[]::new)
-//                     console.parseColor(args[0]),
-//                     console.parseColor(args[1])
                );
            }
            return null;
index 89acbbd..d7a29a3 100644 (file)
@@ -36,7 +36,7 @@ public class Console extends Thread {
        register(Commands.gamma());
        register(Commands.saturation());
        register(Commands.ambientMode());
-       register(Commands.twoColorNoiseMode());
+       register(Commands.noiseMode());
        register(Commands.sunriseMode());
     }
 
similarity index 77%
rename from src/kaka/cakelight/mode/TwoColorNoiseMode.java
rename to src/kaka/cakelight/mode/NoiseMode.java
index 6e8de55..57d973d 100644 (file)
@@ -4,22 +4,15 @@ import kaka.cakelight.Color;
 import kaka.cakelight.LedFrame;
 import kaka.cakelight.util.SimplexNoise3D;
 
-public class TwoColorNoiseMode extends AmbientMode {
-    //    private final Color primary, secondary;
+public class NoiseMode extends AmbientMode {
     private final Color[] colors;
     private SimplexNoise3D noise = new SimplexNoise3D(0);
 
-    public TwoColorNoiseMode(Color... colors) {
+    public NoiseMode(Color... colors) {
        assert colors.length > 1;
         this.colors = colors;
     }
 
-    public TwoColorNoiseMode(Color primary, Color secondary) {
-       this(new Color[] {primary, secondary});
-//        this.primary = primary;
-//        this.secondary = secondary;
-    }
-
     @Override
     protected void updateFrame(LedFrame frame, long time, int count) {
         for (int i = 0; i < config.leds.getCount(); i++) {