@@ -338,11 +338,12 @@ push = push2_python.Push2()
338338# This function is defined in a rather silly way, could probably be optimized a lot ;)
339339def generate_3_color_frame ():
340340 colors = [' {b:05b }{g:06b }{r:05b } ' .format(
341- r = int (32 * random.random()), g = int (64 * random.random()), b = int (32 * random.random())),
342- ' {b:05b }{g:06b }{r:05b } ' .format(
343- r = int (32 * random.random()), g = int (64 * random.random()), b = int (32 * random.random())),
344- ' {b:05b }{g:06b }{r:05b } ' .format(
345- r = int (32 * random.random()), g = int (64 * random.random()), b = int (32 * random.random()))]
341+ r = int (31 * random.random()), g = int (63 * random.random()), b = int (31 * random.random())),
342+ ' {b:05b }{g:06b }{r:05b } ' .format(
343+ r = int (31 * random.random()), g = int (63 * random.random()), b = int (31 * random.random())),
344+ ' {b:05b }{g:06b }{r:05b } ' .format(
345+ r = int (31 * random.random()), g = int (63 * random.random()), b = int (31 * random.random()))]
346+ colors = [int (c, 2 ) for c in colors]
346347 line_bytes = []
347348 for i in range (0 , 960 ): # 960 pixels per line
348349 if i <= 960 // 3 :
@@ -364,7 +365,7 @@ for i in range(0, 20):
364365# Now crate an extra frame which loads an image from a file. Image must be 960x160 pixels.
365366img = Image.open(' test_img_960x160.png' )
366367frame = numpy.array(img)
367- # frame = img_array/255 # Convert rgb values to [0.0, 1.0] floats
368+ frame = img_array/ 255 # Convert rgb values to [0.0, 1.0] floats
368369
369370# Now lets configure some action handlers which will display frames in Push2's display in
370371# reaction to pad and button presses
0 commit comments