1. #! /usr/bin/python
  2.  
  3. import pygame
  4. pygame.init()
  5.  
  6. screen = pygame.display.set_mode((640,480))
  7.  
  8. all_colors = pygame.Surface((4096,4096), depth=24)
  9.  
  10. for r in xrange(256):
  11. print r+1, "out of 256"
  12. x = (r&15)*256
  13. y = (r>>4)*256
  14. for g in xrange(256):
  15. for b in xrange(256):
  16. all_colors.set_at((x+g, y+b),(r,g,b))
  17.  
  18. pygame.image.save(all_colors, "allcolors.bmp")
  19.