import random class DynamicBackground(): def __init__(self): self.current = get_valid_color() self.target = get_valid_color() def draw_background(self, surface): same = True for x in range(0, 3): if self.current[x] > self.target[x]: self.current[x] -= 1 elif self.current[x] 0: i = random.randint(0, 2) color[i] -= - extra return color