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 ...@@ -3,7 +3,7 @@ import time
import json import json
count = 144 count = 144
p = (255, 0, 255) pink = (255, 0, 255)
lightblue = (0, 255, 255) lightblue = (0, 255, 255)
blue = (0, 0, 255) blue = (0, 0, 255)
b = (0, 0, 0) b = (0, 0, 0)
...@@ -29,64 +29,57 @@ def main(): ...@@ -29,64 +29,57 @@ def main():
# pink = (128, 128, 0, 128) # pink = (128, 128, 0, 128)
# sender[universe].dmx_data = (200, 0, 200) # 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) # sender[universe].dmx_data = (5, 6, 7, 8)
## combining two tuples into one: (2, 4) + (5, 4) --> (2, 4, 5) ## combining two tuples into one: (2, 4) + (5, 4) --> (2, 4, 5)
time.sleep(10)
## stopping the sender?! ## stopping the sender?!
sender.stop() sender.stop()
def heart(): def heart(color):
return b + p + p + p + p + b + b + p + p + p + p + b + \ o = (0, 0, 0)
p + p + p + p + p + p + p + p + p + p + p + p + \ x = color
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \ return o + x + x + x + x + o + o + x + x + x + x + o + \
p + p + p + p + p + p + p + p + p + p + p + p + \ x + x + x + x + x + x + x + x + x + x + x + x + \
p + p + p + p + p + p + p + p + p + p + p + p + \ x + x + x + x + x + x + x + x + x + x + x + x + \
b + p + p + p + p + p + p + p + p + p + p + b + \ x + x + x + x + x + x + x + x + x + x + x + x + \
b + p + p + p + p + p + p + p + p + p + p + b + \ x + x + x + x + x + x + x + x + x + x + x + x + \
b + b + p + p + p + p + p + p + p + p + b + b + \ x + x + x + x + x + x + x + x + x + x + x + x + \
b + b + b + p + p + p + p + p + p + b + b + b + \ o + x + x + x + x + x + x + x + x + x + x + o + \
b + b + b + b + p + p + p + p + b + b + b + b + \ o + x + x + x + x + x + x + x + x + x + x + o + \
b + b + b + b + b + p + p + b + b + b + b + b o + o + x + x + x + x + x + x + x + x + o + o + \
o + o + o + x + x + x + x + x + x + o + o + o + \
# def foo(): o + o + o + o + x + x + x + x + o + o + o + o + \
# # print("foo") o + o + o + o + o + x + x + o + o + o + o + o
#
# colors = get_color_pixels('heart-12x12.pixil') def eck(color):
# tupels = hexlist_to_tuples(colors) o = (0, 0, 0)
# x = color
# print(tupels)
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 + \
# def hexlist_to_tuples(hexlist): x + x + x + o + o + o + o + o + o + o + o + o + \
# result = () x + x + x + x + o + o + o + o + o + o + o + o + \
# x + x + x + x + x + o + o + o + o + o + o + o + \
# for c in hexlist: x + x + x + x + x + x + o + o + o + o + o + o + \
# ct = to_color_tuple(c) x + x + x + x + x + x + x + o + o + o + o + o + \
# # print(f'>> color: {ct}') x + x + x + x + x + x + x + x + o + o + o + o + \
# result = result + ct x + x + x + x + x + x + x + x + x + o + o + o + \
# x + x + x + x + x + x + x + x + x + x + o + o + \
# return result 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 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 gimme(color): 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