pycozmo.lights

Helper routines for working with colors and lights.

Classes

Color(int_color, rgb, int, int]] = None, name) A Color to be used with a Light.
class pycozmo.lights.Color(int_color: Optional[int] = None, rgb: Optional[Tuple[int, int, int]] = None, name: str = <class 'NoneType'>)

Bases: object

A Color to be used with a Light.

Either int_color or rgb may be used to specify the actual color. Any alpha components (from int_color) are ignored - all colors are fully opaque.

Args:
int_color (int): A 32 bit value holding the binary RGBA value. rgb (tuple): A tuple holding the integer values from 0-255 for (red, green, blue) name (str): A name to assign to this color
classmethod from_int16(value: int) → pycozmo.lights.Color
int_color
to_int16() → int
pycozmo.lights.green = Color(name=green, int_color=0x00ff00ff)

Green color.

pycozmo.lights.red = Color(name=red, int_color=0xff0000ff)

Red color.

pycozmo.lights.blue = Color(name=blue, int_color=0x0000ffff)

BLue color.

pycozmo.lights.white = Color(name=white, int_color=0xffffffff)

White color.

pycozmo.lights.off = Color(name=off, int_color=0x00000000)

Off/no color.

pycozmo.lights.green_light = LightState(on_color=992, off_color=992, on_frames=0, off_frames=0, transition_on_frames=0, transition_off_frames=0, offset=0)

Green light.

pycozmo.lights.red_light = LightState(on_color=31744, off_color=31744, on_frames=0, off_frames=0, transition_on_frames=0, transition_off_frames=0, offset=0)

Red light.

pycozmo.lights.blue_light = LightState(on_color=31, off_color=31, on_frames=0, off_frames=0, transition_on_frames=0, transition_off_frames=0, offset=0)

Blue light.

pycozmo.lights.white_light = LightState(on_color=32767, off_color=32767, on_frames=0, off_frames=0, transition_on_frames=0, transition_off_frames=0, offset=0)

White light.

pycozmo.lights.off_light = LightState(on_color=0, off_color=0, on_frames=0, off_frames=0, transition_on_frames=0, transition_off_frames=0, offset=0)

Off/no light.