- static Console.Command twoColorNoiseMode() {
- return command(new String[] {"n", "noise"}, (console, args) -> {
- if (args.length == 2) {
- console.getCakelight().setMode(new TwoColorNoiseMode(
- console.parseColor(args[0]),
- console.parseColor(args[1])
- ));
- console.out("setting two-color noise mode");
- return true;
- } else {
- return false;
+ 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 NoiseMode(Stream.of(args)
+ .map(console::parseColor)
+ .toArray(Color[]::new)
+ );