title: PyGame: how do I make a sequence of colors?
body: <p>How can I write a code where I can make my game transition through these colors once per second every 30 frames?</p>
  
  <pre><code>self.bg_color = 0, 0, 0
  self.bg_color = 255, 0, 0
  self.bg_color = 0, 255, 0
  self.bg_color = 0, 0, 255
  self.bg_color = 255, 165, 0
  self.bg_color = 255, 255, 0
  self.bg_color = 199, 97, 20
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>would it help if I showed the skeleton?</p>
  
  <pre><code>from __future__ import division
  import math
  import sys
  import pygame
  
  
  class MyGame(object):
      def __init__(self):
          pygame.mixer.init()
          pygame.mixer.pre_init(44100, -16, 2, 2048)
          pygame.init()
  
          self.width = 800
          self.height = 600
          self.screen = pygame.display.set_mode((self.width, self.height))
  
              self.bg_color = 0, 0, 0
  
          self.FPS = 30
          self.REFRESH = pygame.USEREVENT+1
          pygame.time.set_timer(self.REFRESH, 1000//self.FPS)
  
  
      def run(self):
          running = True
          while running:
              event = pygame.event.wait()
  
              if event.type == pygame.QUIT:
                  running = False
  
              elif event.type == self.REFRESH:
                  self.draw()
  
              else:
                  pass
  
      def draw(self):
          self.screen.fill(self.bg_color)
  
          pygame.display.flip()
  
  
  MyGame().run()
  pygame.quit()
  sys.exit()
  </code></pre>
  
  <p>I've been looking around for a way to do it and so far no luck, that's why I asked here</p>