Commit 7c2f1c4b authored by Christian Wander's avatar Christian Wander
Browse files

adding new shape, more colors

parent 013480e7
......@@ -3,7 +3,7 @@ import time
import json
count = 144
p = (255, 0, 255)
pink = (255, 0, 255)
lightblue = (0, 255, 255)
blue = (0, 0, 255)
b = (0, 0, 0)
......@@ -29,64 +29,57 @@ def main():
# pink = (128, 128, 0, 128)
# sender[universe].dmx_data = (200, 0, 200)
sender[universe].dmx_data = heart()
colors = (pink, lightblue, blue)
while True:
for c in colors:
sender[universe].dmx_data = eck(c)
time.sleep(5)
# sender[universe].dmx_data = (5, 6, 7, 8)
## combining two tuples into one: (2, 4) + (5, 4) --> (2, 4, 5)
time.sleep(10)
## stopping the sender?!
sender.stop()
def heart():
return b + p + p + p + p + b + b + p + p + p + p + b + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
b + p + p + p + p + p + p + p + p + p + p + b + \
b + p + p + p + p + p + p + p + p + p + p + b + \
b + b + p + p + p + p + p + p + p + p + b + b + \
b + b + b + p + p + p + p + p + p + b + b + b + \
b + b + b + b + p + p + p + p + b + b + b + b + \
b + b + b + b + b + p + p + b + b + b + b + b
# def foo():
# # print("foo")
#
# colors = get_color_pixels('heart-12x12.pixil')
# tupels = hexlist_to_tuples(colors)
#
# print(tupels)
# def hexlist_to_tuples(hexlist):
# result = ()
#
# for c in hexlist:
# ct = to_color_tuple(c)
# # print(f'>> color: {ct}')
# result = result + ct
#
# return result
#
#
# def get_color_pixels(file):
#
# colors = None
#
# with open(file) as json_file:
# data = json.load(json_file)
# colors = data['colors']['default colors']
#
# return colors
#
# def to_color_tuple(color):
#
# # tuple(int(s[i:i+2], 16) for i in (0, 2, 4))
# return tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
def heart(color):
o = (0, 0, 0)
x = color
return o + x + x + x + x + o + o + x + x + x + x + o + \
x + x + x + x + x + x + x + x + x + x + x + x + \
x + x + x + x + x + x + x + x + x + x + x + x + \
x + x + x + x + x + x + x + x + x + x + x + x + \
x + x + x + x + x + x + x + x + x + x + x + x + \
x + x + x + x + x + x + x + x + x + x + x + x + \
o + x + x + x + x + x + x + x + x + x + x + o + \
o + x + x + x + x + x + x + x + x + x + x + o + \
o + o + x + x + x + x + x + x + x + x + o + o + \
o + o + o + x + x + x + x + x + x + o + o + o + \
o + o + o + o + x + x + x + x + o + o + o + o + \
o + o + o + o + o + x + x + o + o + o + o + o
def eck(color):
o = (0, 0, 0)
x = color
return x + o + o + o + o + o + o + o + o + o + o + o + \
x + x + o + o + o + o + o + o + o + o + o + o + \
x + x + x + o + o + o + o + o + o + o + o + o + \
x + x + x + x + o + o + o + o + o + o + o + o + \
x + x + x + x + x + o + o + o + o + o + o + o + \
x + x + x + x + x + x + o + o + o + o + o + o + \
x + x + x + x + x + x + x + o + o + o + o + o + \
x + x + x + x + x + x + x + x + o + o + o + o + \
x + x + x + x + x + x + x + x + x + o + o + o + \
x + x + x + x + x + x + x + x + x + x + o + o + \
x + x + x + x + x + x + x + x + x + x + x + o + \
x + x + x + x + x + x + x + x + x + x + x + x
def gimme(color):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment