Inspired by a pattern on a storage box I own I decided to try program something simulating it. This program shows variously colored boxes with a black gap in between. You can adjust the box size, the gap size and even how many boxes will appear on the screen (all changeable in the code).
The pattern will be newly generated every half a second.
Boxes 2 Boxes 3 Boxes 10 Boxes 11 Boxes 6

# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 28th of May, 2015

Continue reading

JClock II

This is an alternative clock design. Version two is even prettier to look at.
Instead of a few clock hands spinning their circles, every hour, minute, second and centisecond is represented as differently colored circles on four imagined circles around the center. That way you have a visualization by quantity, not by position.
This clock face would represent 21:46:42.

How to read the clock

  • 21 green circles
    • represents 21 hours
  • 46 teal circles
    • represents 46 minutes
  • 42 blue circles
    • represents 42 seconds
  • some white circles
    • represents centiseconds (one hundredth of a second, mainly for the look)
  • Current time: 21:46:42

# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 18th of May, 2015
#         edited 19th of May, 2015
#         edited 20th of May, 2015

Continue reading

Colors VI

This sixth version of my ‘Colors’ program has only a few improvements. At first it uses a different method to change the individual pixels. Instead of using ‘pygame.PixelArray()’ it calls on the surface ‘.set_at()’. Also you get an indicator if it has finished drawing (to be seen in the caption). At last it always – not needing a user input – saves the drawing if it is finished.
To get more information on my ‘Colors’ program, see ‘Colors V’.

Image 1 Image 2 Image 3

# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 23rd of March, 2015
#         edited  2nd of April, 2015
#         edited 20th of May  , 2015

Here goes the ‘getColor()’ function.
Continue reading