Esempio n. 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))
Esempio n. 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
Esempio n. 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
Esempio n. 5
0
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) )
Esempio n. 6
0
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))