source: rgbkbd/trunk/rgbkbd/modes/anglemotionmode.py @ 71

Last change on this file since 71 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
2from rgbkbd.core import Monochrome, KeyboardMode
3from rgbkbd.color import Colors
4from rgbkbd.animation import AngleMotionPattern, MotionAnimation
5
6# Keyboard Mode
7def 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.