X-Git-Url: http://dolda2000.com/gitweb/?p=kaka%2Fcakelight.git;a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FConsole.java;h=caae09b80793726b9e25ecf0245954a6116cb53f;hp=7d864d85c31a6096f60579c2f26a5e0c3b2746c8;hb=884380465ae1ae412b7e5858ade7fd3f77da497f;hpb=a4fb845a65eb734bc9ee681e4756cf1a405c4ac8 diff --git a/src/kaka/cakelight/Console.java b/src/kaka/cakelight/Console.java index 7d864d8..caae09b 100644 --- a/src/kaka/cakelight/Console.java +++ b/src/kaka/cakelight/Console.java @@ -38,6 +38,15 @@ public class Console extends Thread { cakelight.turnOff(); System.out.println("stopping cakelight"); break; + } else if (input.matches("(c|col|color)(\\s+[0-9]+){3}")) { + String[] split = input.split("\\s+"); + Color c = Color.rgb( + Integer.parseInt(split[1]), + Integer.parseInt(split[2]), + Integer.parseInt(split[3]) + ); + cakelight.setMode(new SingleColorMode(c)); + System.out.println("setting color to " + c); } } catch (IOException e) { System.out.println("Error reading from command line");