double g = Math.pow(Math.min(1, Math.max(0, noise.getr(0.0, 1.0, 1, x, y, time / 7000.0))), 1.5);
frame.setLedColor(i, Color.rgb(1, g, 0));
}
+ } else if (type == 5) {
+ for (int i = 0; i < config.leds.getCount(); i++) {
+ double x = frame.xOf(i);
+ double y = frame.yOf(i);
+ double hue = (Math.min(1, Math.max(0, noise.getr(0.0, 1.0, 4, x, y, time / 7000.0))) + (time / 100000.0)) % 1.0;
+ frame.setLedColor(i, Color.hsv(hue, 1, 1));
+ }
}
}
System.out.print("> ");
try {
String input = reader.readLine();
- if (input.equals("0") || input.equals("1") || input.equals("2") || input.equals("3") || input.equals("4")) {
+ if (input.matches("[0-5]")) {
cakelight.setMode(new AmbientMode(new String[] {input}));
System.out.println("setting ambient mode to " + input);
} else if (input.matches("(b|brightness)\\s+[0-9]+")) {