255, 255, 255, 255, 0, 127, 255, ]) # check if the second swirl should be build if enableSecond and len(custColors2) > 1: S2 = True baS2 = buildGradient(custColors2) # effect loop while not hyperion.abort(): angle += increment if angle > 360: angle = 0 if angle < 0: angle = 360 angle2 += increment2 if angle2 > 360: angle2 = 0 if angle2 < 0: angle2 = 360 hyperion.imageConicalGradient(pointS1[0], pointS1[1], angle, baS1) if S2: hyperion.imageConicalGradient(pointS2[0], pointS2[1], angle2, baS2) hyperion.imageShow() time.sleep(sleepTime)
# table of stop colors for rainbow gradient, first is the position, next rgb, all values 0-255 rainbowColors = bytearray([ 0 ,255,0 ,0, 255, 25 ,255,230,0, 255, 63 ,255,255,0, 255, 100,0 ,255,0, 255, 127,0 ,255,200, 255, 159,0 ,255,255, 255, 191,0 ,0 ,255, 255, 224,255,0 ,255, 255, 255,255,0 ,127, 255, #0, 255, 0, 0, 255, #42, 255, 255, 0, 255, #85, 0, 255, 0, 255, #128, 0, 255, 255, 255, #170, 0, 0, 255, 255, #212, 255, 0, 255, 255, #255, 255, 0, 0, 255, ]) # effect loop while not hyperion.abort(): angle += increment if angle > 360: angle=0 if angle < 0: angle=360 hyperion.imageCanonicalGradient(centerX, centerY, angle, rainbowColors) hyperion.imageShow() time.sleep(sleepTime)
def switchImage(): global nr if nr >= len(imgIds): nr = 0 hyperion.imageShow(imgIds[nr]) nr += 1