RSS Git Download  Clone
  hilbert Convert to module 7 months ago
  .gitignore 19B Added .gitignore 5 months ago 809B Fixed indentation in 7 months ago
  hilbert.png 11kB README 7 months ago 372B Convert to module 7 months ago
# Hilbert curve Draw hilbert curves as an image. # How to run ``` $ python ``` ![Output](hilbert.png) # Documentation direction is an ```int``` type representing the 4 directions in a 2D plane - left, top, right, bottom ```python from PIL import Image colors = ("blue", "orange", "green", "red", "violet", "brown", "pink", "gray", "yellow", "cyan") img ="RGB", (1000, 1000), color="white") draw_hilbert(image=img, # Image object from Pillow direction=0, # 0 means the curve starts from the left depth=4, # How many levels deep we should go while dividing the image into quandrants colors=c, # All the different colors that the line segments will be drawin in width=50) # Width of the line segment ```