Browse Source

nicer colors

feature/balanceutils
Fr3deric 8 years ago committed by Frederic
parent
commit
1784321ec8
  1. 9
      colorwischer.py

9
colorwischer.py

@ -1,12 +1,15 @@
#!/usr/bin/python #!/usr/bin/python3
import sys import sys
import colorsys
import blup.animation import blup.animation
import blup.frame import blup.frame
import writebml import writebml
import random import random
def getRandomColor(maxval):
return list(map(lambda x: int(round(x*maxval)), colorsys.hsv_to_rgb(random.random(), 1, 1)))
dim = blup.frame.FrameDimension(22, 16, 256, 3) dim = blup.frame.FrameDimension(22, 16, 256, 3)
newanim = blup.animation.Animation(dim) newanim = blup.animation.Animation(dim)
@ -15,7 +18,7 @@ num = 10
horiz = True horiz = True
delay = 100 delay = 100
for i in range(num): for i in range(num):
newcolor = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) newcolor = getRandomColor(dim.depth - 1)
horiz = not horiz horiz = not horiz
if horiz: if horiz:
for x in range(dim.size()[0]): for x in range(dim.size()[0]):

Loading…
Cancel
Save