def create_effects(self): self.effects = [] color1 = Colors.hls_to_rgb(self.hue1, 1, 1) color2 = Colors.hls_to_rgb(self.hue2, 1, 1) for l in self.grass.get_leaves_array(): self.effects.append(AlternateColorEvery3Effect(l[0], color1, color2)) self.effects.append(AlternateColorEvery3Effect(l[1][:], color1, color2))
def create_effects(self): self.effects = [] color1 = Colors.hls_to_rgb(self.hue1, 1, 1) color2 = Colors.hls_to_rgb(self.hue2, 1, 1) self.effects.append( AlternateColorEvery3Effect(self.flower.bottom_parts, color1, color2)) self.effects.append( AlternateColorEvery3Effect(self.flower.get_leaves(), color1, color2)) self.effects.append(AlwaysOnEffect(self.flower.seeds, color1))
def create_effects(self): leavesEffect = AlternateColorEvery3Effect(self.flower.get_leaves(), self.current_color1, self.current_color2) indexes = self.flower.get_seeds() random.shuffle(indexes) seedsEffect = AdvanceEffect.initColor(indexes, self.current_color2, self.current_color1) self.effects = [leavesEffect, seedsEffect]
def create_effects(self): self.effects = [] color1 = Colors.hls_to_rgb(self.hue1, 1, 1) color2 = Colors.hls_to_rgb(self.hue2, 1, 1) self.effects.append(AlternateColorEvery3Effect(self.sheep.body, color1, color2)) self.effects.append(AlwaysOnEffect(self.sheep.head + self.sheep.legs, color1)) self.effects.append(AlwaysOnEffect(self.sheep.eyes, color2))
def create_effects(self): bodyEffect = AlternateColorEvery3Effect(self.sheep.get_body_indexes(),self.current_color1,self.current_color2) #leg12Effect = AlternateColor2ArraysEffect(self.sheep.get_leg12_side1_indexes(),self.sheep.get_leg12_side2_indexes() ,self.current_color1,self.current_color2) #leg34Effect = AlternateColor2ArraysEffect(self.sheep.get_leg34_side1_indexes(),self.sheep.get_leg34_side2_indexes() ,self.current_color1,self.current_color2) legsEffect1 = AlwaysOnEffect(self.sheep.get_leg12_side1_indexes() + self.sheep.get_leg34_side1_indexes(), self.current_color2) legsEffect2 = AlwaysOnEffect(self.sheep.get_leg12_side2_indexes() + self.sheep.get_leg34_side2_indexes(), self.current_color1) headEffect = AlwaysOnEffect(self.sheep.get_head_indexes(),self.current_color1) earsEffect1 = AdvanceEffect.initColor(self.sheep.get_inner_ear_indexes()[::-1], self.current_color2, self.current_color1) earsEffect2 = AdvanceEffect.initColor(self.sheep.get_outer_ear_indexes()[::-1], self.current_color2, self.current_color1) self.effects = [bodyEffect, legsEffect1, legsEffect2, headEffect, earsEffect1, earsEffect2]
def apply(self, time_percent): spin = int(math.floor(time_percent * self.num_of_spins)) if (spin != self.current_spin): self.current_spin = spin self.hue1 = Colors.reduce_by_1(self.hue1 + 0.4) self.hue2 = Colors.reduce_by_1(self.hue1+0.25) self.current_color1 = [int(c*255) for c in colorsys.hsv_to_rgb(self.hue1, 1.0, 0.15)] self.current_color2 = [int(c*255) for c in colorsys.hsv_to_rgb(self.hue2, 1.0, 0.15)] self.effect = AlternateColorEvery3Effect(self.signs.get_all_indexes(),self.current_color1,self.current_color2) oneSpinTime = 1.0 / self.num_of_spins relativePercent = (time_percent - oneSpinTime * self.current_spin) * self.num_of_spins self.effect.apply(relativePercent, self.signs.get_array())
def create_effects(self): self.effects = [] color1 = Colors.hls_to_rgb(self.hue1, 1, 1) color2 = Colors.hls_to_rgb(self.hue2, 1, 1) self.effects.append(AlternateColorEvery3Effect(self.tree.get_all_indexes(), color1, color2))