def METHOD_NAME(self):
    def from_hex(color):
        """
        Convert hex color #xxx or #xxxxxx to [r, g, b].
        """
        if not HEX_RE.match(color):
            color = "#FFF"
        if len(color) == 7:
            return (int(color[1:3], 16), int(color[3:5], 16), int(color[5:], 16))
        return (
            int(color[1], 16) * 17,
            int(color[2], 16) * 17,
            int(color[3], 16) * 17,
        )
    def to_hex(color):
        """
        Convert [r, g, b] to hex.
        """
        return "#{:02X}{:02X}{:02X}".format(int(color[0]), int(color[1]), int(color[2]))
    def make_color(c1, c2, t):
        """
        Generate a mid color between c1 and c2.
        """
        def fade(i):
            a = c1[i]
            b = c2[i]
            x = b * t
            x += a * (1 - t)
            return x
        c1 = from_hex(c1)
        c2 = from_hex(c2)
        return (fade(0), fade(1), fade(2))
    colors = []
    if self.steps == 1:
        colors = [to_hex(from_hex(x)) for x in self.gradient]
    else:
        for grad_a, grad_b in zip(self.gradient, self.gradient[1:]):
            for j in range(self.steps):
                colors.append(to_hex(make_color(grad_a, grad_b, j / self.steps)))
    self.colors = colors
    self.active_color = 0
    self._set_cycle_time()