});
}
- 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;
register(Commands.gamma());
register(Commands.saturation());
register(Commands.ambientMode());
- register(Commands.twoColorNoiseMode());
+ register(Commands.noiseMode());
register(Commands.sunriseMode());
}
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++) {