def apply(self, time_percent, parent_array): for i in range(len(self.indexes)): index = self.indexes[i] percent = float(i) / len(self.indexes) percent = math.pow(percent, self.power) color = Colors.go_to_color(self.from_color, self.to_color, percent) parent_array[index * 3:index * 3 + 3] = color
def apply(self, time_precent, parent_array): power = time_precent if self.type == GoToColorEffectType.FAST_TO_SLOW: power = math.pow(time_precent, 0.25) elif self.type == GoToColorEffectType.SLOW_TO_FAST: power = math.pow(time_precent, 4) color = Colors.go_to_color(self.from_color, self.to_color, power) for i in self.indexes: parent_array[i * 3:i * 3 + 3] = color
def apply(self, time_precent, parent_array): power = time_precent if self.type == GoToColorEffectType.FAST_TO_SLOW: power = math.pow(time_precent, 0.25) elif self.type == GoToColorEffectType.SLOW_TO_FAST: power = math.pow(time_precent, 4) for i in range(len(self.indexes)): index = self.indexes[i] color = Colors.go_to_color(self.from_colors[i*3:i*3+3], self.to_colors[i*3:i*3+3], power) parent_array[index*3 : index*3+3] = color