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.
39 lines
1012 B
39 lines
1012 B
8 years ago
|
#!/usr/bin/python3
|
||
8 years ago
|
|
||
|
import sys
|
||
8 years ago
|
import colorsys
|
||
8 years ago
|
import blup.animation
|
||
|
import blup.frame
|
||
7 years ago
|
import blup.writebml
|
||
8 years ago
|
import random
|
||
|
|
||
8 years ago
|
def getRandomColor(maxval):
|
||
|
return list(map(lambda x: int(round(x*maxval)), colorsys.hsv_to_rgb(random.random(), 1, 1)))
|
||
|
|
||
8 years ago
|
dim = blup.frame.FrameDimension(22, 16, 256, 3)
|
||
8 years ago
|
newanim = blup.animation.Animation(dim)
|
||
|
|
||
|
|
||
|
num = 10
|
||
|
horiz = True
|
||
|
delay = 100
|
||
|
for i in range(num):
|
||
8 years ago
|
newcolor = getRandomColor(dim.depth - 1)
|
||
8 years ago
|
horiz = not horiz
|
||
|
if horiz:
|
||
|
for x in range(dim.size()[0]):
|
||
|
newframe = blup.animation.AnimationFrame(dim, delay)
|
||
|
for y in range(dim.size()[1]):
|
||
|
newframe.setPixel(x, y, newcolor)
|
||
|
newanim.addFrame(newframe)
|
||
|
else:
|
||
|
for y in range(dim.size()[1]):
|
||
|
newframe = blup.animation.AnimationFrame(dim, delay)
|
||
|
for x in range(dim.size()[0]):
|
||
|
newframe.setPixel(x, y, newcolor)
|
||
|
newanim.addFrame(newframe)
|
||
8 years ago
|
|
||
|
|
||
|
|
||
|
writebml.writeBml(newanim, '/tmp/colorwischer.bml')
|