You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
851 B

8 years ago
#!/usr/bin/python
import colorsys
import time
import blup.output
import blup.frame
dim = blup.frame.FrameDimension(18,8,16,3)
frame = blup.frame.Frame(dim)
HEIGHT = 8
WIDTH = 18
#h = 0.0
#for y in range(HEIGHT):
# h += 1.0 / (HEIGHT * 1.0)
# v = 0
# s = 0.7
# for x in range(WIDTH):
# v += 1.0 / (WIDTH * 1.0)
# print s
# color = colorsys.hsv_to_rgb(h, s, v)
# color = tuple(map(lambda c: int(round(c * 15)), color))
# print color
# frame.setPixel(x, y, color)
for y in range(HEIGHT):
for x in range(WIDTH):
h = (x * 1.0) / (WIDTH - 1.0)
s = 1.0 - (y * 1.0) / (HEIGHT - 0.0)
v = 1.0 - (y * 1.0) / (HEIGHT - 0.0)
color = colorsys.hsv_to_rgb(h, s, v)
color = tuple(map(lambda c: int(round(c * 15)), color))
frame.setPixel(x, y, color)
out = blup.output.getOutput('e3blp')
while True:
out.sendFrame(frame)
time.sleep(0.4)