예제 #1
0
 def nextColor(self):
     """ If a color palette is set, move to the next color in the palette,
         otherwise, move around the color wheel by self.hueDelta
     """
     if self.colorPalette:
         self.color_idx = (self.color_idx + 1) % len(self.colorPalette)
         return self.colorPalette[self.color_idx]
     else:
         return hsvColorAdd(self.color, (self.hueDelta, 0, 0))
 def nextColor(self):
     """ If a color palette is set, move to the next color in the palette,
         otherwise, move around the color wheel by self.hueDelta
     """
     if self.colorPalette:
         self.color_idx = (self.color_idx + 1) % len(self.colorPalette)
         return self.colorPalette[self.color_idx]
     else:
         return hsvColorAdd(self.color, (self.hueDelta, 0, 0))
예제 #3
0
 def setWipeStateFromButtons(self, params):
     """ if we detect a new button-press and aren't already in the middle of a wipe,
     set a new color and make the current color the old color """
     if (params.buttonState[0] or params.buttonState[1]):
         if not self.buttonDown and not self.wipeStartTime:
             self.buttonDown = True
             self.wipeStartTime = time.time()
             self.oldColor = self.color
             self.color = hsvColorAdd(self.color, (self.hueDelta, 0, 0))
     else:
         self.buttonDown = False
예제 #4
0
 def setWipeStateFromButtons(self, params):
     """ if we detect a new button-press and aren't already in the middle of a wipe,
     set a new color and make the current color the old color """
     if (params.buttonState[0] or params.buttonState[1]):
         if not self.buttonDown and not self.wipeStartTime:
             self.buttonDown = True
             self.wipeStartTime = time.time()
             self.oldColor = self.color
             self.color = hsvColorAdd(self.color, (self.hueDelta, 0, 0))
     else:
         self.buttonDown = False
예제 #5
0
파일: colorwave.py 프로젝트: BobKerns/pulse
def mutateColor(color, hue_jitter=0.1, sat_jitter=0.5, val_jitter=0.5):
    return hsvColorAdd(color, colorJitter(hue_jitter, sat_jitter, val_jitter) )
예제 #6
0
파일: colorwave.py 프로젝트: mct/soma
def mutateColor(color, hue_jitter=0.1, sat_jitter=0.5, val_jitter=0.5):
    return hsvColorAdd(color, colorJitter(hue_jitter, sat_jitter, val_jitter))