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.
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import blup.animation
|
|
|
|
import blup.frame
|
|
|
|
import writebml
|
|
|
|
import random
|
|
|
|
|
|
|
|
dim = blup.frame.FrameDimension(22, 16, 256, 3)
|
|
|
|
newanim = blup.animation.Animation(dim)
|
|
|
|
|
|
|
|
|
|
|
|
num = 10
|
|
|
|
horiz = True
|
|
|
|
delay = 100
|
|
|
|
for i in range(num):
|
|
|
|
newcolor = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writebml.writeBml(newanim, '/tmp/colorwischer.bml')
|