Last change
on this file was
71,
checked in by retracile, 9 years ago
|
Initial import of source code
|
-
Property svn:executable set to
*
|
File size:
795 bytes
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | from rgbkbd.core import Monochrome, KeyboardMode |
---|
3 | from rgbkbd.color import Colors |
---|
4 | from rgbkbd.animation import AngleMotionPattern, MotionAnimation |
---|
5 | |
---|
6 | # Keyboard Mode |
---|
7 | def AngleMotionMode(manager, keyboard, colors=(Colors.WHITE, Colors.BLACK), |
---|
8 | period=5, color_pattern_cls=None, angle=0.0, size=50): |
---|
9 | """Keyboard mode to apply a color pattern with a linear motion""" |
---|
10 | color_pattern = color_pattern_cls(colors=colors, period=period) |
---|
11 | motion_pattern = AngleMotionPattern(angle=angle, size=size, period=period) |
---|
12 | animation = MotionAnimation(keyboard=keyboard, color_pattern=color_pattern, |
---|
13 | motion_pattern=motion_pattern) |
---|
14 | return KeyboardMode(manager, keyboard, |
---|
15 | static_lighting=Monochrome(keyboard, color=colors[-1]), |
---|
16 | animations=[animation]) |
---|
Note: See
TracBrowser
for help on using the repository browser.