double value = Math.abs((ledOffset * 2 - ledCount) / ledCount); // 1 to 0 to 1
frame.setLedColor(i, Color.hsv(value * hueLength + hueOffset, 1, 1));
}
+ } else if (type == 3) {
+ for (int i = 0; i < config.leds.getCount(); i++) {
+ double x = frame.xOf(i);
+ double y = frame.yOf(i);
+ 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(0, g, 1 - g * 0.5));
+ }
+ } else if (type == 4) {
+ for (int i = 0; i < config.leds.getCount(); i++) {
+ double x = frame.xOf(i);
+ double y = frame.yOf(i);
+ 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));
+ }
}
}
System.out.print("> ");
try {
String input = reader.readLine();
- if (input.equals("0") || input.equals("1") || input.equals("2")) {
+ if (input.equals("0") || input.equals("1") || input.equals("2") || input.equals("3") || input.equals("4")) {
cakelight.setMode(new AmbientMode(new String[] {input}));
System.out.println("setting ambient mode to " + input);
} else if (input.matches("(b|brightness)\\s+[0-9]+")) {